it.go 36 KB

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