lu_CD.go 25 KB

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