bas_CM.go 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593
  1. package bas_CM
  2. import (
  3. "math"
  4. "strconv"
  5. "time"
  6. "github.com/go-playground/locales"
  7. "github.com/go-playground/locales/currency"
  8. )
  9. type bas_CM struct {
  10. locale string
  11. pluralsCardinal []locales.PluralRule
  12. pluralsOrdinal []locales.PluralRule
  13. pluralsRange []locales.PluralRule
  14. decimal []byte
  15. group []byte
  16. minus []byte
  17. percent []byte
  18. percentSuffix []byte
  19. perMille []byte
  20. timeSeparator []byte
  21. inifinity []byte
  22. currencies [][]byte // idx = enum of currency code
  23. currencyPositiveSuffix []byte
  24. currencyNegativeSuffix []byte
  25. monthsAbbreviated [][]byte
  26. monthsNarrow [][]byte
  27. monthsWide [][]byte
  28. daysAbbreviated [][]byte
  29. daysNarrow [][]byte
  30. daysShort [][]byte
  31. daysWide [][]byte
  32. periodsAbbreviated [][]byte
  33. periodsNarrow [][]byte
  34. periodsShort [][]byte
  35. periodsWide [][]byte
  36. erasAbbreviated [][]byte
  37. erasNarrow [][]byte
  38. erasWide [][]byte
  39. timezones map[string][]byte
  40. }
  41. // New returns a new instance of translator for the 'bas_CM' locale
  42. func New() locales.Translator {
  43. return &bas_CM{
  44. locale: "bas_CM",
  45. pluralsCardinal: nil,
  46. pluralsOrdinal: nil,
  47. pluralsRange: nil,
  48. decimal: []byte{0x2c},
  49. group: []byte{0xc2, 0xa0},
  50. minus: []byte{},
  51. percent: []byte{},
  52. perMille: []byte{},
  53. timeSeparator: []byte{0x3a},
  54. currencies: [][]uint8{{0x41, 0x44, 0x50, 0x20}, {0x41, 0x45, 0x44, 0x20}, {0x41, 0x46, 0x41, 0x20}, {0x41, 0x46, 0x4e, 0x20}, {0x41, 0x4c, 0x4b, 0x20}, {0x41, 0x4c, 0x4c, 0x20}, {0x41, 0x4d, 0x44, 0x20}, {0x41, 0x4e, 0x47, 0x20}, {0x41, 0x4f, 0x41, 0x20}, {0x41, 0x4f, 0x4b, 0x20}, {0x41, 0x4f, 0x4e, 0x20}, {0x41, 0x4f, 0x52, 0x20}, {0x41, 0x52, 0x41, 0x20}, {0x41, 0x52, 0x4c, 0x20}, {0x41, 0x52, 0x4d, 0x20}, {0x41, 0x52, 0x50, 0x20}, {0x41, 0x52, 0x53, 0x20}, {0x41, 0x54, 0x53, 0x20}, {0x41, 0x55, 0x44, 0x20}, {0x41, 0x57, 0x47, 0x20}, {0x41, 0x5a, 0x4d, 0x20}, {0x41, 0x5a, 0x4e, 0x20}, {0x42, 0x41, 0x44, 0x20}, {0x42, 0x41, 0x4d, 0x20}, {0x42, 0x41, 0x4e, 0x20}, {0x42, 0x42, 0x44, 0x20}, {0x42, 0x44, 0x54, 0x20}, {0x42, 0x45, 0x43, 0x20}, {0x42, 0x45, 0x46, 0x20}, {0x42, 0x45, 0x4c, 0x20}, {0x42, 0x47, 0x4c, 0x20}, {0x42, 0x47, 0x4d, 0x20}, {0x42, 0x47, 0x4e, 0x20}, {0x42, 0x47, 0x4f, 0x20}, {0x42, 0x48, 0x44, 0x20}, {0x42, 0x49, 0x46, 0x20}, {0x42, 0x4d, 0x44, 0x20}, {0x42, 0x4e, 0x44, 0x20}, {0x42, 0x4f, 0x42, 0x20}, {0x42, 0x4f, 0x4c, 0x20}, {0x42, 0x4f, 0x50, 0x20}, {0x42, 0x4f, 0x56, 0x20}, {0x42, 0x52, 0x42, 0x20}, {0x42, 0x52, 0x43, 0x20}, {0x42, 0x52, 0x45, 0x20}, {0x42, 0x52, 0x4c, 0x20}, {0x42, 0x52, 0x4e, 0x20}, {0x42, 0x52, 0x52, 0x20}, {0x42, 0x52, 0x5a, 0x20}, {0x42, 0x53, 0x44, 0x20}, {0x42, 0x54, 0x4e, 0x20}, {0x42, 0x55, 0x4b, 0x20}, {0x42, 0x57, 0x50, 0x20}, {0x42, 0x59, 0x42, 0x20}, {0x42, 0x59, 0x52, 0x20}, {0x42, 0x5a, 0x44, 0x20}, {0x43, 0x41, 0x44, 0x20}, {0x43, 0x44, 0x46, 0x20}, {0x43, 0x48, 0x45, 0x20}, {0x43, 0x48, 0x46, 0x20}, {0x43, 0x48, 0x57, 0x20}, {0x43, 0x4c, 0x45, 0x20}, {0x43, 0x4c, 0x46, 0x20}, {0x43, 0x4c, 0x50, 0x20}, {0x43, 0x4e, 0x58, 0x20}, {0x43, 0x4e, 0x59, 0x20}, {0x43, 0x4f, 0x50, 0x20}, {0x43, 0x4f, 0x55, 0x20}, {0x43, 0x52, 0x43, 0x20}, {0x43, 0x53, 0x44, 0x20}, {0x43, 0x53, 0x4b, 0x20}, {0x43, 0x55, 0x43, 0x20}, {0x43, 0x55, 0x50, 0x20}, {0x43, 0x56, 0x45, 0x20}, {0x43, 0x59, 0x50, 0x20}, {0x43, 0x5a, 0x4b, 0x20}, {0x44, 0x44, 0x4d, 0x20}, {0x44, 0x45, 0x4d, 0x20}, {0x44, 0x4a, 0x46, 0x20}, {0x44, 0x4b, 0x4b, 0x20}, {0x44, 0x4f, 0x50, 0x20}, {0x44, 0x5a, 0x44, 0x20}, {0x45, 0x43, 0x53, 0x20}, {0x45, 0x43, 0x56, 0x20}, {0x45, 0x45, 0x4b, 0x20}, {0x45, 0x47, 0x50, 0x20}, {0x45, 0x52, 0x4e, 0x20}, {0x45, 0x53, 0x41, 0x20}, {0x45, 0x53, 0x42, 0x20}, {0x45, 0x53, 0x50, 0x20}, {0x45, 0x54, 0x42, 0x20}, {0x45, 0x55, 0x52, 0x20}, {0x46, 0x49, 0x4d, 0x20}, {0x46, 0x4a, 0x44, 0x20}, {0x46, 0x4b, 0x50, 0x20}, {0x46, 0x52, 0x46, 0x20}, {0x47, 0x42, 0x50, 0x20}, {0x47, 0x45, 0x4b, 0x20}, {0x47, 0x45, 0x4c, 0x20}, {0x47, 0x48, 0x43, 0x20}, {0x47, 0x48, 0x53, 0x20}, {0x47, 0x49, 0x50, 0x20}, {0x47, 0x4d, 0x44, 0x20}, {0x47, 0x4e, 0x46, 0x20}, {0x47, 0x4e, 0x53, 0x20}, {0x47, 0x51, 0x45, 0x20}, {0x47, 0x52, 0x44, 0x20}, {0x47, 0x54, 0x51, 0x20}, {0x47, 0x57, 0x45, 0x20}, {0x47, 0x57, 0x50, 0x20}, {0x47, 0x59, 0x44, 0x20}, {0x48, 0x4b, 0x44, 0x20}, {0x48, 0x4e, 0x4c, 0x20}, {0x48, 0x52, 0x44, 0x20}, {0x48, 0x52, 0x4b, 0x20}, {0x48, 0x54, 0x47, 0x20}, {0x48, 0x55, 0x46, 0x20}, {0x49, 0x44, 0x52, 0x20}, {0x49, 0x45, 0x50, 0x20}, {0x49, 0x4c, 0x50, 0x20}, {0x49, 0x4c, 0x52, 0x20}, {0x49, 0x4c, 0x53, 0x20}, {0x49, 0x4e, 0x52, 0x20}, {0x49, 0x51, 0x44, 0x20}, {0x49, 0x52, 0x52, 0x20}, {0x49, 0x53, 0x4a, 0x20}, {0x49, 0x53, 0x4b, 0x20}, {0x49, 0x54, 0x4c, 0x20}, {0x4a, 0x4d, 0x44, 0x20}, {0x4a, 0x4f, 0x44, 0x20}, {0x4a, 0x50, 0x59, 0x20}, {0x4b, 0x45, 0x53, 0x20}, {0x4b, 0x47, 0x53, 0x20}, {0x4b, 0x48, 0x52, 0x20}, {0x4b, 0x4d, 0x46, 0x20}, {0x4b, 0x50, 0x57, 0x20}, {0x4b, 0x52, 0x48, 0x20}, {0x4b, 0x52, 0x4f, 0x20}, {0x4b, 0x52, 0x57, 0x20}, {0x4b, 0x57, 0x44, 0x20}, {0x4b, 0x59, 0x44, 0x20}, {0x4b, 0x5a, 0x54, 0x20}, {0x4c, 0x41, 0x4b, 0x20}, {0x4c, 0x42, 0x50, 0x20}, {0x4c, 0x4b, 0x52, 0x20}, {0x4c, 0x52, 0x44, 0x20}, {0x4c, 0x53, 0x4c, 0x20}, {0x4c, 0x54, 0x4c, 0x20}, {0x4c, 0x54, 0x54, 0x20}, {0x4c, 0x55, 0x43, 0x20}, {0x4c, 0x55, 0x46, 0x20}, {0x4c, 0x55, 0x4c, 0x20}, {0x4c, 0x56, 0x4c, 0x20}, {0x4c, 0x56, 0x52, 0x20}, {0x4c, 0x59, 0x44, 0x20}, {0x4d, 0x41, 0x44, 0x20}, {0x4d, 0x41, 0x46, 0x20}, {0x4d, 0x43, 0x46, 0x20}, {0x4d, 0x44, 0x43, 0x20}, {0x4d, 0x44, 0x4c, 0x20}, {0x4d, 0x47, 0x41, 0x20}, {0x4d, 0x47, 0x46, 0x20}, {0x4d, 0x4b, 0x44, 0x20}, {0x4d, 0x4b, 0x4e, 0x20}, {0x4d, 0x4c, 0x46, 0x20}, {0x4d, 0x4d, 0x4b, 0x20}, {0x4d, 0x4e, 0x54, 0x20}, {0x4d, 0x4f, 0x50, 0x20}, {0x4d, 0x52, 0x4f, 0x20}, {0x4d, 0x54, 0x4c, 0x20}, {0x4d, 0x54, 0x50, 0x20}, {0x4d, 0x55, 0x52, 0x20}, {0x4d, 0x56, 0x50, 0x20}, {0x4d, 0x56, 0x52, 0x20}, {0x4d, 0x57, 0x4b, 0x20}, {0x4d, 0x58, 0x4e, 0x20}, {0x4d, 0x58, 0x50, 0x20}, {0x4d, 0x58, 0x56, 0x20}, {0x4d, 0x59, 0x52, 0x20}, {0x4d, 0x5a, 0x45, 0x20}, {0x4d, 0x5a, 0x4d, 0x20}, {0x4d, 0x5a, 0x4e, 0x20}, {0x4e, 0x41, 0x44, 0x20}, {0x4e, 0x47, 0x4e, 0x20}, {0x4e, 0x49, 0x43, 0x20}, {0x4e, 0x49, 0x4f, 0x20}, {0x4e, 0x4c, 0x47, 0x20}, {0x4e, 0x4f, 0x4b, 0x20}, {0x4e, 0x50, 0x52, 0x20}, {0x4e, 0x5a, 0x44, 0x20}, {0x4f, 0x4d, 0x52, 0x20}, {0x50, 0x41, 0x42, 0x20}, {0x50, 0x45, 0x49, 0x20}, {0x50, 0x45, 0x4e, 0x20}, {0x50, 0x45, 0x53, 0x20}, {0x50, 0x47, 0x4b, 0x20}, {0x50, 0x48, 0x50, 0x20}, {0x50, 0x4b, 0x52, 0x20}, {0x50, 0x4c, 0x4e, 0x20}, {0x50, 0x4c, 0x5a, 0x20}, {0x50, 0x54, 0x45, 0x20}, {0x50, 0x59, 0x47, 0x20}, {0x51, 0x41, 0x52, 0x20}, {0x52, 0x48, 0x44, 0x20}, {0x52, 0x4f, 0x4c, 0x20}, {0x52, 0x4f, 0x4e, 0x20}, {0x52, 0x53, 0x44, 0x20}, {0x52, 0x55, 0x42, 0x20}, {0x52, 0x55, 0x52, 0x20}, {0x52, 0x57, 0x46, 0x20}, {0x53, 0x41, 0x52, 0x20}, {0x53, 0x42, 0x44, 0x20}, {0x53, 0x43, 0x52, 0x20}, {0x53, 0x44, 0x44, 0x20}, {0x53, 0x44, 0x47, 0x20}, {0x53, 0x44, 0x50, 0x20}, {0x53, 0x45, 0x4b, 0x20}, {0x53, 0x47, 0x44, 0x20}, {0x53, 0x48, 0x50, 0x20}, {0x53, 0x49, 0x54, 0x20}, {0x53, 0x4b, 0x4b, 0x20}, {0x53, 0x4c, 0x4c, 0x20}, {0x53, 0x4f, 0x53, 0x20}, {0x53, 0x52, 0x44, 0x20}, {0x53, 0x52, 0x47, 0x20}, {0x53, 0x53, 0x50, 0x20}, {0x53, 0x54, 0x44, 0x20}, {0x53, 0x55, 0x52, 0x20}, {0x53, 0x56, 0x43, 0x20}, {0x53, 0x59, 0x50, 0x20}, {0x53, 0x5a, 0x4c, 0x20}, {0x54, 0x48, 0x42, 0x20}, {0x54, 0x4a, 0x52, 0x20}, {0x54, 0x4a, 0x53, 0x20}, {0x54, 0x4d, 0x4d, 0x20}, {0x54, 0x4d, 0x54, 0x20}, {0x54, 0x4e, 0x44, 0x20}, {0x54, 0x4f, 0x50, 0x20}, {0x54, 0x50, 0x45, 0x20}, {0x54, 0x52, 0x4c, 0x20}, {0x54, 0x52, 0x59, 0x20}, {0x54, 0x54, 0x44, 0x20}, {0x54, 0x57, 0x44, 0x20}, {0x54, 0x5a, 0x53, 0x20}, {0x55, 0x41, 0x48, 0x20}, {0x55, 0x41, 0x4b, 0x20}, {0x55, 0x47, 0x53, 0x20}, {0x55, 0x47, 0x58, 0x20}, {0x55, 0x53, 0x44, 0x20}, {0x55, 0x53, 0x4e, 0x20}, {0x55, 0x53, 0x53, 0x20}, {0x55, 0x59, 0x49, 0x20}, {0x55, 0x59, 0x50, 0x20}, {0x55, 0x59, 0x55, 0x20}, {0x55, 0x5a, 0x53, 0x20}, {0x56, 0x45, 0x42, 0x20}, {0x56, 0x45, 0x46, 0x20}, {0x56, 0x4e, 0x44, 0x20}, {0x56, 0x4e, 0x4e, 0x20}, {0x56, 0x55, 0x56, 0x20}, {0x57, 0x53, 0x54, 0x20}, {0x58, 0x41, 0x46, 0x20}, {0x58, 0x41, 0x47, 0x20}, {0x58, 0x41, 0x55, 0x20}, {0x58, 0x42, 0x41, 0x20}, {0x58, 0x42, 0x42, 0x20}, {0x58, 0x42, 0x43, 0x20}, {0x58, 0x42, 0x44, 0x20}, {0x58, 0x43, 0x44, 0x20}, {0x58, 0x44, 0x52, 0x20}, {0x58, 0x45, 0x55, 0x20}, {0x58, 0x46, 0x4f, 0x20}, {0x58, 0x46, 0x55, 0x20}, {0x58, 0x4f, 0x46, 0x20}, {0x58, 0x50, 0x44, 0x20}, {0x58, 0x50, 0x46, 0x20}, {0x58, 0x50, 0x54, 0x20}, {0x58, 0x52, 0x45, 0x20}, {0x58, 0x53, 0x55, 0x20}, {0x58, 0x54, 0x53, 0x20}, {0x58, 0x55, 0x41, 0x20}, {0x58, 0x58, 0x58, 0x20}, {0x59, 0x44, 0x44, 0x20}, {0x59, 0x45, 0x52, 0x20}, {0x59, 0x55, 0x44, 0x20}, {0x59, 0x55, 0x4d, 0x20}, {0x59, 0x55, 0x4e, 0x20}, {0x59, 0x55, 0x52, 0x20}, {0x5a, 0x41, 0x4c, 0x20}, {0x5a, 0x41, 0x52, 0x20}, {0x5a, 0x4d, 0x4b, 0x20}, {0x5a, 0x4d, 0x57, 0x20}, {0x5a, 0x52, 0x4e, 0x20}, {0x5a, 0x52, 0x5a, 0x20}, {0x5a, 0x57, 0x44, 0x20}, {0x5a, 0x57, 0x4c, 0x20}, {0x5a, 0x57, 0x52, 0x20}},
  55. percentSuffix: []byte{0xc2, 0xa0},
  56. currencyPositiveSuffix: []byte{0xc2, 0xa0},
  57. currencyNegativeSuffix: []byte{0xc2, 0xa0},
  58. monthsAbbreviated: [][]uint8{[]uint8(nil), {0x6b, 0xc9, 0x94, 0x6e}, {0x6d, 0x61, 0x63}, {0x6d, 0x61, 0x74}, {0x6d, 0x74, 0x6f}, {0x6d, 0x70, 0x75}, {0x68, 0x69, 0x6c}, {0x6e, 0x6a, 0x65}, {0x68, 0x69, 0x6b}, {0x64, 0x69, 0x70}, {0x62, 0x69, 0x6f}, {0x6d, 0x61, 0x79}, {0x6c, 0x69, 0xc9, 0x93}},
  59. monthsNarrow: [][]uint8{[]uint8(nil), {0x6b}, {0x6d}, {0x6d}, {0x6d}, {0x6d}, {0x68}, {0x6e}, {0x68}, {0x64}, {0x62}, {0x6d}, {0x6c}},
  60. monthsWide: [][]uint8{[]uint8(nil), {0x4b, 0xc9, 0x94, 0x6e, 0x64, 0xc9, 0x94, 0xc5, 0x8b}, {0x4d, 0xc3, 0xa0, 0x63, 0xc9, 0x9b, 0xcc, 0x82, 0x6c}, {0x4d, 0xc3, 0xa0, 0x74, 0xc3, 0xb9, 0x6d, 0x62}, {0x4d, 0xc3, 0xa0, 0x74, 0x6f, 0x70}, {0x4d, 0xcc, 0x80, 0x70, 0x75, 0x79, 0xc9, 0x9b}, {0x48, 0xc3, 0xac, 0x6c, 0xc3, 0xb2, 0x6e, 0x64, 0xc9, 0x9b, 0xcc, 0x80}, {0x4e, 0x6a, 0xc3, 0xa8, 0x62, 0xc3, 0xa0}, {0x48, 0xc3, 0xac, 0x6b, 0x61, 0xc5, 0x8b}, {0x44, 0xc3, 0xac, 0x70, 0xc9, 0x94, 0xcc, 0x80, 0x73}, {0x42, 0xc3, 0xac, 0xc3, 0xb2, 0xc3, 0xb4, 0x6d}, {0x4d, 0xc3, 0xa0, 0x79, 0xc9, 0x9b, 0x73, 0xc3, 0xa8, 0x70}, {0x4c, 0xc3, 0xac, 0x62, 0x75, 0x79, 0x20, 0x6c, 0x69, 0x20, 0xc5, 0x84, 0x79, 0xc3, 0xa8, 0x65}},
  61. daysAbbreviated: [][]uint8{{0x6e, 0xc9, 0x94, 0x79}, {0x6e, 0x6a, 0x61}, {0x75, 0x75, 0x6d}, {0xc5, 0x8b, 0x67, 0x65}, {0x6d, 0x62, 0xc9, 0x94}, {0x6b, 0xc9, 0x94, 0xc9, 0x94}, {0x6a, 0x6f, 0x6e}},
  62. daysNarrow: [][]uint8{{0x6e}, {0x6e}, {0x75}, {0xc5, 0x8b}, {0x6d}, {0x6b}, {0x6a}},
  63. daysWide: [][]uint8{{0xc5, 0x8b, 0x67, 0x77, 0xc3, 0xa0, 0x20, 0x6e, 0xc9, 0x94, 0xcc, 0x82, 0x79}, {0xc5, 0x8b, 0x67, 0x77, 0xc3, 0xa0, 0x20, 0x6e, 0x6a, 0x61, 0xc5, 0x8b, 0x67, 0x75, 0x6d, 0x62, 0x61}, {0xc5, 0x8b, 0x67, 0x77, 0xc3, 0xa0, 0x20, 0xc3, 0xbb, 0x6d}, {0xc5, 0x8b, 0x67, 0x77, 0xc3, 0xa0, 0x20, 0xc5, 0x8b, 0x67, 0xc3, 0xaa}, {0xc5, 0x8b, 0x67, 0x77, 0xc3, 0xa0, 0x20, 0x6d, 0x62, 0xc9, 0x94, 0x6b}, {0xc5, 0x8b, 0x67, 0x77, 0xc3, 0xa0, 0x20, 0x6b, 0xc9, 0x94, 0xc9, 0x94}, {0xc5, 0x8b, 0x67, 0x77, 0xc3, 0xa0, 0x20, 0x6a, 0xc3, 0xb4, 0x6e}},
  64. periodsAbbreviated: [][]uint8{{0x49, 0x20, 0x62, 0x69, 0x6b, 0xc9, 0x9b, 0xcc, 0x82, 0x67, 0x6c, 0xc3, 0xa0}, {0x49, 0x20, 0xc9, 0x93, 0x75, 0x67, 0x61, 0x6a, 0xc9, 0x94, 0x70}},
  65. periodsWide: [][]uint8{{0x49, 0x20, 0x62, 0x69, 0x6b, 0xc9, 0x9b, 0xcc, 0x82, 0x67, 0x6c, 0xc3, 0xa0}, {0x49, 0x20, 0xc9, 0x93, 0x75, 0x67, 0x61, 0x6a, 0xc9, 0x94, 0x70}},
  66. erasAbbreviated: [][]uint8{{0x62, 0x2e, 0x59, 0x2e, 0x4b}, {0x6d, 0x2e, 0x59, 0x2e, 0x4b}},
  67. erasNarrow: [][]uint8{[]uint8(nil), []uint8(nil)},
  68. erasWide: [][]uint8{{0x62, 0x69, 0x73, 0xc5, 0xab, 0x20, 0x62, 0x69, 0x20, 0x59, 0x65, 0x73, 0xc3, 0xb9, 0x20, 0x4b, 0x72, 0xc7, 0x90, 0x73, 0x74, 0xc3, 0xb2}, {0x69, 0x20, 0x6d, 0x62, 0xc5, 0xab, 0x73, 0x20, 0x59, 0x65, 0x73, 0xc3, 0xb9, 0x20, 0x4b, 0x72, 0xc7, 0x90, 0x73, 0x74, 0xc3, 0xb2}},
  69. timezones: map[string][]uint8{"TMST": {0x54, 0x4d, 0x53, 0x54}, "COT": {0x43, 0x4f, 0x54}, "CAT": {0x43, 0x41, 0x54}, "WITA": {0x57, 0x49, 0x54, 0x41}, "HNT": {0x48, 0x4e, 0x54}, "WARST": {0x57, 0x41, 0x52, 0x53, 0x54}, "WAT": {0x57, 0x41, 0x54}, "WESZ": {0x57, 0x45, 0x53, 0x5a}, "AEDT": {0x41, 0x45, 0x44, 0x54}, "ACDT": {0x41, 0x43, 0x44, 0x54}, "MEZ": {0x4d, 0x45, 0x5a}, "PST": {0x50, 0x53, 0x54}, "JDT": {0x4a, 0x44, 0x54}, "SRT": {0x53, 0x52, 0x54}, "EST": {0x45, 0x53, 0x54}, "CLST": {0x43, 0x4c, 0x53, 0x54}, "WEZ": {0x57, 0x45, 0x5a}, "GYT": {0x47, 0x59, 0x54}, "AEST": {0x41, 0x45, 0x53, 0x54}, "MST": {0x4d, 0x53, 0x54}, "GMT": {0x47, 0x4d, 0x54}, "ART": {0x41, 0x52, 0x54}, "ChST": {0x43, 0x68, 0x53, 0x54}, "IST": {0x49, 0x53, 0x54}, "BT": {0x42, 0x54}, "MESZ": {0x4d, 0x45, 0x53, 0x5a}, "HADT": {0x48, 0x41, 0x44, 0x54}, "ADT": {0x41, 0x44, 0x54}, "WIT": {0x57, 0x49, 0x54}, "AKST": {0x41, 0x4b, 0x53, 0x54}, "GFT": {0x47, 0x46, 0x54}, "HAT": {0x48, 0x41, 0x54}, "CST": {0x43, 0x53, 0x54}, "AST": {0x41, 0x53, 0x54}, "JST": {0x4a, 0x53, 0x54}, "NZDT": {0x4e, 0x5a, 0x44, 0x54}, "ACWST": {0x41, 0x43, 0x57, 0x53, 0x54}, "HKT": {0x48, 0x4b, 0x54}, "ACST": {0x41, 0x43, 0x53, 0x54}, "CHAST": {0x43, 0x48, 0x41, 0x53, 0x54}, "CLT": {0x43, 0x4c, 0x54}, "WAST": {0x57, 0x41, 0x53, 0x54}, "AWST": {0x41, 0x57, 0x53, 0x54}, "UYT": {0x55, 0x59, 0x54}, "VET": {0x56, 0x45, 0x54}, "COST": {0x43, 0x4f, 0x53, 0x54}, "HAST": {0x48, 0x41, 0x53, 0x54}, "∅∅∅": {0xe2, 0x88, 0x85, 0xe2, 0x88, 0x85, 0xe2, 0x88, 0x85}, "OEZ": {0x4f, 0x45, 0x5a}, "TMT": {0x54, 0x4d, 0x54}, "BOT": {0x42, 0x4f, 0x54}, "PDT": {0x50, 0x44, 0x54}, "MYT": {0x4d, 0x59, 0x54}, "HKST": {0x48, 0x4b, 0x53, 0x54}, "ECT": {0x45, 0x43, 0x54}, "SGT": {0x53, 0x47, 0x54}, "EDT": {0x45, 0x44, 0x54}, "NZST": {0x4e, 0x5a, 0x53, 0x54}, "ACWDT": {0x41, 0x43, 0x57, 0x44, 0x54}, "AWDT": {0x41, 0x57, 0x44, 0x54}, "WIB": {0x57, 0x49, 0x42}, "CDT": {0x43, 0x44, 0x54}, "OESZ": {0x4f, 0x45, 0x53, 0x5a}, "UYST": {0x55, 0x59, 0x53, 0x54}, "ARST": {0x41, 0x52, 0x53, 0x54}, "AKDT": {0x41, 0x4b, 0x44, 0x54}, "LHST": {0x4c, 0x48, 0x53, 0x54}, "LHDT": {0x4c, 0x48, 0x44, 0x54}, "MDT": {0x4d, 0x44, 0x54}, "EAT": {0x45, 0x41, 0x54}, "SAST": {0x53, 0x41, 0x53, 0x54}, "WART": {0x57, 0x41, 0x52, 0x54}, "CHADT": {0x43, 0x48, 0x41, 0x44, 0x54}},
  70. }
  71. }
  72. // Locale returns the current translators string locale
  73. func (bas *bas_CM) Locale() string {
  74. return bas.locale
  75. }
  76. // PluralsCardinal returns the list of cardinal plural rules associated with 'bas_CM'
  77. func (bas *bas_CM) PluralsCardinal() []locales.PluralRule {
  78. return bas.pluralsCardinal
  79. }
  80. // PluralsOrdinal returns the list of ordinal plural rules associated with 'bas_CM'
  81. func (bas *bas_CM) PluralsOrdinal() []locales.PluralRule {
  82. return bas.pluralsOrdinal
  83. }
  84. // PluralsRange returns the list of range plural rules associated with 'bas_CM'
  85. func (bas *bas_CM) PluralsRange() []locales.PluralRule {
  86. return bas.pluralsRange
  87. }
  88. // CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'bas_CM'
  89. func (bas *bas_CM) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
  90. return locales.PluralRuleUnknown
  91. }
  92. // OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'bas_CM'
  93. func (bas *bas_CM) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
  94. return locales.PluralRuleUnknown
  95. }
  96. // RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'bas_CM'
  97. func (bas *bas_CM) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
  98. return locales.PluralRuleUnknown
  99. }
  100. // MonthAbbreviated returns the locales abbreviated month given the 'month' provided
  101. func (bas *bas_CM) MonthAbbreviated(month time.Month) []byte {
  102. return bas.monthsAbbreviated[month]
  103. }
  104. // MonthsAbbreviated returns the locales abbreviated months
  105. func (bas *bas_CM) MonthsAbbreviated() [][]byte {
  106. return bas.monthsAbbreviated[1:]
  107. }
  108. // MonthNarrow returns the locales narrow month given the 'month' provided
  109. func (bas *bas_CM) MonthNarrow(month time.Month) []byte {
  110. return bas.monthsNarrow[month]
  111. }
  112. // MonthsNarrow returns the locales narrow months
  113. func (bas *bas_CM) MonthsNarrow() [][]byte {
  114. return bas.monthsNarrow[1:]
  115. }
  116. // MonthWide returns the locales wide month given the 'month' provided
  117. func (bas *bas_CM) MonthWide(month time.Month) []byte {
  118. return bas.monthsWide[month]
  119. }
  120. // MonthsWide returns the locales wide months
  121. func (bas *bas_CM) MonthsWide() [][]byte {
  122. return bas.monthsWide[1:]
  123. }
  124. // WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
  125. func (bas *bas_CM) WeekdayAbbreviated(weekday time.Weekday) []byte {
  126. return bas.daysAbbreviated[weekday]
  127. }
  128. // WeekdaysAbbreviated returns the locales abbreviated weekdays
  129. func (bas *bas_CM) WeekdaysAbbreviated() [][]byte {
  130. return bas.daysAbbreviated
  131. }
  132. // WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
  133. func (bas *bas_CM) WeekdayNarrow(weekday time.Weekday) []byte {
  134. return bas.daysNarrow[weekday]
  135. }
  136. // WeekdaysNarrow returns the locales narrow weekdays
  137. func (bas *bas_CM) WeekdaysNarrow() [][]byte {
  138. return bas.daysNarrow
  139. }
  140. // WeekdayShort returns the locales short weekday given the 'weekday' provided
  141. func (bas *bas_CM) WeekdayShort(weekday time.Weekday) []byte {
  142. return bas.daysShort[weekday]
  143. }
  144. // WeekdaysShort returns the locales short weekdays
  145. func (bas *bas_CM) WeekdaysShort() [][]byte {
  146. return bas.daysShort
  147. }
  148. // WeekdayWide returns the locales wide weekday given the 'weekday' provided
  149. func (bas *bas_CM) WeekdayWide(weekday time.Weekday) []byte {
  150. return bas.daysWide[weekday]
  151. }
  152. // WeekdaysWide returns the locales wide weekdays
  153. func (bas *bas_CM) WeekdaysWide() [][]byte {
  154. return bas.daysWide
  155. }
  156. // FmtNumber returns 'num' with digits/precision of 'v' for 'bas_CM' and handles both Whole and Real numbers based on 'v'
  157. // returned as a []byte just in case the caller wishes to add more and can help
  158. // avoid allocations; otherwise just cast as string.
  159. func (bas *bas_CM) FmtNumber(num float64, v uint64) []byte {
  160. s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
  161. l := len(s) + len(bas.decimal) + len(bas.group)*len(s[:len(s)-int(v)-1])/3
  162. count := 0
  163. inWhole := v == 0
  164. b := make([]byte, 0, l)
  165. for i := len(s) - 1; i >= 0; i-- {
  166. if s[i] == '.' {
  167. b = append(b, bas.decimal[0])
  168. inWhole = true
  169. continue
  170. }
  171. if inWhole {
  172. if count == 3 {
  173. for j := len(bas.group) - 1; j >= 0; j-- {
  174. b = append(b, bas.group[j])
  175. }
  176. count = 1
  177. } else {
  178. count++
  179. }
  180. }
  181. b = append(b, s[i])
  182. }
  183. if num < 0 {
  184. for j := len(bas.minus) - 1; j >= 0; j-- {
  185. b = append(b, bas.minus[j])
  186. }
  187. }
  188. // reverse
  189. for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
  190. b[i], b[j] = b[j], b[i]
  191. }
  192. return b
  193. }
  194. // FmtPercent returns 'num' with digits/precision of 'v' for 'bas_CM' and handles both Whole and Real numbers based on 'v'
  195. // returned as a []byte just in case the caller wishes to add more and can help
  196. // avoid allocations; otherwise just cast as string.
  197. // NOTE: 'num' passed into FmtPercent is assumed to be in percent already
  198. func (bas *bas_CM) FmtPercent(num float64, v uint64) []byte {
  199. s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
  200. l := len(s) + len(bas.decimal)
  201. b := make([]byte, 0, l)
  202. for i := len(s) - 1; i >= 0; i-- {
  203. if s[i] == '.' {
  204. b = append(b, bas.decimal[0])
  205. continue
  206. }
  207. b = append(b, s[i])
  208. }
  209. if num < 0 {
  210. for j := len(bas.minus) - 1; j >= 0; j-- {
  211. b = append(b, bas.minus[j])
  212. }
  213. }
  214. // reverse
  215. for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
  216. b[i], b[j] = b[j], b[i]
  217. }
  218. b = append(b, bas.percentSuffix...)
  219. b = append(b, bas.percent...)
  220. return b
  221. }
  222. // FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'bas_CM'
  223. // returned as a []byte just in case the caller wishes to add more and can help
  224. // avoid allocations; otherwise just cast as string.
  225. func (bas *bas_CM) FmtCurrency(num float64, v uint64, currency currency.Type) []byte {
  226. s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
  227. symbol := bas.currencies[currency]
  228. l := len(s) + len(bas.decimal) + len(bas.group)*len(s[:len(s)-int(v)-1])/3
  229. count := 0
  230. inWhole := v == 0
  231. b := make([]byte, 0, l)
  232. for i := len(s) - 1; i >= 0; i-- {
  233. if s[i] == '.' {
  234. b = append(b, bas.decimal[0])
  235. inWhole = true
  236. continue
  237. }
  238. if inWhole {
  239. if count == 3 {
  240. for j := len(bas.group) - 1; j >= 0; j-- {
  241. b = append(b, bas.group[j])
  242. }
  243. count = 1
  244. } else {
  245. count++
  246. }
  247. }
  248. b = append(b, s[i])
  249. }
  250. if num < 0 {
  251. for j := len(bas.minus) - 1; j >= 0; j-- {
  252. b = append(b, bas.minus[j])
  253. }
  254. }
  255. // reverse
  256. for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
  257. b[i], b[j] = b[j], b[i]
  258. }
  259. if int(v) < 2 {
  260. if v == 0 {
  261. b = append(b, bas.decimal...)
  262. }
  263. for i := 0; i < 2-int(v); i++ {
  264. b = append(b, '0')
  265. }
  266. }
  267. b = append(b, bas.currencyPositiveSuffix...)
  268. b = append(b, symbol...)
  269. return b
  270. }
  271. // FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'bas_CM'
  272. // in accounting notation. returned as a []byte just in case the caller wishes to add more and can help
  273. // avoid allocations; otherwise just cast as string.
  274. func (bas *bas_CM) FmtAccounting(num float64, v uint64, currency currency.Type) []byte {
  275. s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
  276. symbol := bas.currencies[currency]
  277. l := len(s) + len(bas.decimal) + len(bas.group)*len(s[:len(s)-int(v)-1])/3
  278. count := 0
  279. inWhole := v == 0
  280. b := make([]byte, 0, l)
  281. for i := len(s) - 1; i >= 0; i-- {
  282. if s[i] == '.' {
  283. b = append(b, bas.decimal[0])
  284. inWhole = true
  285. continue
  286. }
  287. if inWhole {
  288. if count == 3 {
  289. for j := len(bas.group) - 1; j >= 0; j-- {
  290. b = append(b, bas.group[j])
  291. }
  292. count = 1
  293. } else {
  294. count++
  295. }
  296. }
  297. b = append(b, s[i])
  298. }
  299. if num < 0 {
  300. for j := len(bas.minus) - 1; j >= 0; j-- {
  301. b = append(b, bas.minus[j])
  302. }
  303. }
  304. // reverse
  305. for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
  306. b[i], b[j] = b[j], b[i]
  307. }
  308. if int(v) < 2 {
  309. if v == 0 {
  310. b = append(b, bas.decimal...)
  311. }
  312. for i := 0; i < 2-int(v); i++ {
  313. b = append(b, '0')
  314. }
  315. }
  316. if num < 0 {
  317. b = append(b, bas.currencyNegativeSuffix...)
  318. b = append(b, symbol...)
  319. } else {
  320. b = append(b, bas.currencyPositiveSuffix...)
  321. b = append(b, symbol...)
  322. }
  323. return b
  324. }
  325. // FmtDateShort returns the short date representation of 't' for 'bas_CM'
  326. // returned as a []byte just in case the caller wishes to add more and can help
  327. // avoid allocations; otherwise just cast as string.
  328. func (bas *bas_CM) FmtDateShort(t time.Time) []byte {
  329. b := make([]byte, 0, 32)
  330. b = strconv.AppendInt(b, int64(t.Day()), 10)
  331. b = append(b, []byte{0x2f}...)
  332. b = strconv.AppendInt(b, int64(t.Month()), 10)
  333. b = append(b, []byte{0x2f}...)
  334. b = strconv.AppendInt(b, int64(t.Year()), 10)
  335. return b
  336. }
  337. // FmtDateMedium returns the medium date representation of 't' for 'bas_CM'
  338. // returned as a []byte just in case the caller wishes to add more and can help
  339. // avoid allocations; otherwise just cast as string.
  340. func (bas *bas_CM) FmtDateMedium(t time.Time) []byte {
  341. b := make([]byte, 0, 32)
  342. b = strconv.AppendInt(b, int64(t.Day()), 10)
  343. b = append(b, []byte{0x20}...)
  344. b = append(b, bas.monthsAbbreviated[t.Month()]...)
  345. b = append(b, []byte{0x2c, 0x20}...)
  346. b = strconv.AppendInt(b, int64(t.Year()), 10)
  347. return b
  348. }
  349. // FmtDateLong returns the long date representation of 't' for 'bas_CM'
  350. // returned as a []byte just in case the caller wishes to add more and can help
  351. // avoid allocations; otherwise just cast as string.
  352. func (bas *bas_CM) FmtDateLong(t time.Time) []byte {
  353. b := make([]byte, 0, 32)
  354. b = strconv.AppendInt(b, int64(t.Day()), 10)
  355. b = append(b, []byte{0x20}...)
  356. b = append(b, bas.monthsWide[t.Month()]...)
  357. b = append(b, []byte{0x20}...)
  358. b = strconv.AppendInt(b, int64(t.Year()), 10)
  359. return b
  360. }
  361. // FmtDateFull returns the full date representation of 't' for 'bas_CM'
  362. // returned as a []byte just in case the caller wishes to add more and can help
  363. // avoid allocations; otherwise just cast as string.
  364. func (bas *bas_CM) FmtDateFull(t time.Time) []byte {
  365. b := make([]byte, 0, 32)
  366. b = append(b, bas.daysWide[t.Weekday()]...)
  367. b = append(b, []byte{0x20}...)
  368. b = strconv.AppendInt(b, int64(t.Day()), 10)
  369. b = append(b, []byte{0x20}...)
  370. b = append(b, bas.monthsWide[t.Month()]...)
  371. b = append(b, []byte{0x20}...)
  372. b = strconv.AppendInt(b, int64(t.Year()), 10)
  373. return b
  374. }
  375. // FmtTimeShort returns the short time representation of 't' for 'bas_CM'
  376. // returned as a []byte just in case the caller wishes to add more and can help
  377. // avoid allocations; otherwise just cast as string.
  378. func (bas *bas_CM) FmtTimeShort(t time.Time) []byte {
  379. b := make([]byte, 0, 32)
  380. if t.Hour() < 10 {
  381. b = append(b, '0')
  382. }
  383. b = strconv.AppendInt(b, int64(t.Hour()), 10)
  384. b = append(b, bas.timeSeparator...)
  385. if t.Minute() < 10 {
  386. b = append(b, '0')
  387. }
  388. b = strconv.AppendInt(b, int64(t.Minute()), 10)
  389. return b
  390. }
  391. // FmtTimeMedium returns the medium time representation of 't' for 'bas_CM'
  392. // returned as a []byte just in case the caller wishes to add more and can help
  393. // avoid allocations; otherwise just cast as string.
  394. func (bas *bas_CM) FmtTimeMedium(t time.Time) []byte {
  395. b := make([]byte, 0, 32)
  396. if t.Hour() < 10 {
  397. b = append(b, '0')
  398. }
  399. b = strconv.AppendInt(b, int64(t.Hour()), 10)
  400. b = append(b, bas.timeSeparator...)
  401. if t.Minute() < 10 {
  402. b = append(b, '0')
  403. }
  404. b = strconv.AppendInt(b, int64(t.Minute()), 10)
  405. b = append(b, bas.timeSeparator...)
  406. if t.Second() < 10 {
  407. b = append(b, '0')
  408. }
  409. b = strconv.AppendInt(b, int64(t.Second()), 10)
  410. return b
  411. }
  412. // FmtTimeLong returns the long time representation of 't' for 'bas_CM'
  413. // returned as a []byte just in case the caller wishes to add more and can help
  414. // avoid allocations; otherwise just cast as string.
  415. func (bas *bas_CM) FmtTimeLong(t time.Time) []byte {
  416. b := make([]byte, 0, 32)
  417. if t.Hour() < 10 {
  418. b = append(b, '0')
  419. }
  420. b = strconv.AppendInt(b, int64(t.Hour()), 10)
  421. b = append(b, bas.timeSeparator...)
  422. if t.Minute() < 10 {
  423. b = append(b, '0')
  424. }
  425. b = strconv.AppendInt(b, int64(t.Minute()), 10)
  426. b = append(b, bas.timeSeparator...)
  427. if t.Second() < 10 {
  428. b = append(b, '0')
  429. }
  430. b = strconv.AppendInt(b, int64(t.Second()), 10)
  431. b = append(b, []byte{0x20}...)
  432. tz, _ := t.Zone()
  433. b = append(b, tz...)
  434. return b
  435. }
  436. // FmtTimeFull returns the full time representation of 't' for 'bas_CM'
  437. // returned as a []byte just in case the caller wishes to add more and can help
  438. // avoid allocations; otherwise just cast as string.
  439. func (bas *bas_CM) FmtTimeFull(t time.Time) []byte {
  440. b := make([]byte, 0, 32)
  441. if t.Hour() < 10 {
  442. b = append(b, '0')
  443. }
  444. b = strconv.AppendInt(b, int64(t.Hour()), 10)
  445. b = append(b, bas.timeSeparator...)
  446. if t.Minute() < 10 {
  447. b = append(b, '0')
  448. }
  449. b = strconv.AppendInt(b, int64(t.Minute()), 10)
  450. b = append(b, bas.timeSeparator...)
  451. if t.Second() < 10 {
  452. b = append(b, '0')
  453. }
  454. b = strconv.AppendInt(b, int64(t.Second()), 10)
  455. b = append(b, []byte{0x20}...)
  456. tz, _ := t.Zone()
  457. if btz, ok := bas.timezones[tz]; ok {
  458. b = append(b, btz...)
  459. } else {
  460. b = append(b, tz...)
  461. }
  462. return b
  463. }