pl_PL.go 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626
  1. package pl_PL
  2. import (
  3. "math"
  4. "strconv"
  5. "time"
  6. "github.com/go-playground/locales"
  7. "github.com/go-playground/locales/currency"
  8. )
  9. type pl_PL struct {
  10. locale string
  11. pluralsCardinal []locales.PluralRule
  12. pluralsOrdinal []locales.PluralRule
  13. pluralsRange []locales.PluralRule
  14. decimal string
  15. group string
  16. minus string
  17. percent string
  18. perMille string
  19. timeSeparator string
  20. inifinity string
  21. currencies []string // idx = enum of currency code
  22. currencyPositiveSuffix string
  23. currencyNegativePrefix string
  24. currencyNegativeSuffix string
  25. monthsAbbreviated []string
  26. monthsNarrow []string
  27. monthsWide []string
  28. daysAbbreviated []string
  29. daysNarrow []string
  30. daysShort []string
  31. daysWide []string
  32. periodsAbbreviated []string
  33. periodsNarrow []string
  34. periodsShort []string
  35. periodsWide []string
  36. erasAbbreviated []string
  37. erasNarrow []string
  38. erasWide []string
  39. timezones map[string]string
  40. }
  41. // New returns a new instance of translator for the 'pl_PL' locale
  42. func New() locales.Translator {
  43. return &pl_PL{
  44. locale: "pl_PL",
  45. pluralsCardinal: []locales.PluralRule{2, 4, 5, 6},
  46. pluralsOrdinal: []locales.PluralRule{6},
  47. pluralsRange: []locales.PluralRule{4, 5, 6, 2},
  48. decimal: ",",
  49. group: " ",
  50. minus: "-",
  51. percent: "%",
  52. perMille: "‰",
  53. timeSeparator: ":",
  54. inifinity: "∞",
  55. currencies: []string{"ADP ", "AED ", "AFA ", "AFN ", "ALK ", "ALL ", "AMD ", "ANG ", "AOA ", "AOK ", "AON ", "AOR ", "ARA ", "ARL ", "ARM ", "ARP ", "ARS ", "ATS ", "AUD ", "AWG ", "AZM ", "AZN ", "BAD ", "BAM ", "BAN ", "BBD ", "BDT ", "BEC ", "BEF ", "BEL ", "BGL ", "BGM ", "BGN ", "BGO ", "BHD ", "BIF ", "BMD ", "BND ", "BOB ", "BOL ", "BOP ", "BOV ", "BRB ", "BRC ", "BRE ", "BRL ", "BRN ", "BRR ", "BRZ ", "BSD ", "BTN ", "BUK ", "BWP ", "BYB ", "BYR ", "BZD ", "CAD ", "CDF ", "CHE ", "CHF ", "CHW ", "CLE ", "CLF ", "CLP ", "CNX ", "CNY ", "COP ", "COU ", "CRC ", "CSD ", "CSK ", "CUC ", "CUP ", "CVE ", "CYP ", "CZK ", "DDM ", "DEM ", "DJF ", "DKK ", "DOP ", "DZD ", "ECS ", "ECV ", "EEK ", "EGP ", "ERN ", "ESA ", "ESB ", "ESP ", "ETB ", "EUR ", "FIM ", "FJD ", "FKP ", "FRF ", "GBP ", "GEK ", "GEL ", "GHC ", "GHS ", "GIP ", "GMD ", "GNF ", "GNS ", "GQE ", "GRD ", "GTQ ", "GWE ", "GWP ", "GYD ", "HKD ", "HNL ", "HRD ", "HRK ", "HTG ", "HUF ", "IDR ", "IEP ", "ILP ", "ILR ", "ILS ", "INR ", "IQD ", "IRR ", "ISJ ", "ISK ", "ITL ", "JMD ", "JOD ", "JPY ", "KES ", "KGS ", "KHR ", "KMF ", "KPW ", "KRH ", "KRO ", "KRW ", "KWD ", "KYD ", "KZT ", "LAK ", "LBP ", "LKR ", "LRD ", "LSL ", "LTL ", "LTT ", "LUC ", "LUF ", "LUL ", "LVL ", "LVR ", "LYD ", "MAD ", "MAF ", "MCF ", "MDC ", "MDL ", "MGA ", "MGF ", "MKD ", "MKN ", "MLF ", "MMK ", "MNT ", "MOP ", "MRO ", "MTL ", "MTP ", "MUR ", "MVP ", "MVR ", "MWK ", "MXN ", "MXP ", "MXV ", "MYR ", "MZE ", "MZM ", "MZN ", "NAD ", "NGN ", "NIC ", "NIO ", "NLG ", "NOK ", "NPR ", "NZD ", "OMR ", "PAB ", "PEI ", "PEN ", "PES ", "PGK ", "PHP ", "PKR ", "PLN ", "PLZ ", "PTE ", "PYG ", "QAR ", "RHD ", "ROL ", "RON ", "RSD ", "RUB ", "RUR ", "RWF ", "SAR ", "SBD ", "SCR ", "SDD ", "SDG ", "SDP ", "SEK ", "SGD ", "SHP ", "SIT ", "SKK ", "SLL ", "SOS ", "SRD ", "SRG ", "SSP ", "STD ", "SUR ", "SVC ", "SYP ", "SZL ", "THB ", "TJR ", "TJS ", "TMM ", "TMT ", "TND ", "TOP ", "TPE ", "TRL ", "TRY ", "TTD ", "TWD ", "TZS ", "UAH ", "UAK ", "UGS ", "UGX ", "USD ", "USN ", "USS ", "UYI ", "UYP ", "UYU ", "UZS ", "VEB ", "VEF ", "VND ", "VNN ", "VUV ", "WST ", "XAF ", "XAG ", "XAU ", "XBA ", "XBB ", "XBC ", "XBD ", "XCD ", "XDR ", "XEU ", "XFO ", "XFU ", "XOF ", "XPD ", "XPF ", "XPT ", "XRE ", "XSU ", "XTS ", "XUA ", "XXX ", "YDD ", "YER ", "YUD ", "YUM ", "YUN ", "YUR ", "ZAL ", "ZAR ", "ZMK ", "ZMW ", "ZRN ", "ZRZ ", "ZWD ", "ZWL ", "ZWR "},
  56. currencyPositiveSuffix: " ",
  57. currencyNegativePrefix: "(",
  58. currencyNegativeSuffix: " )",
  59. monthsAbbreviated: []string{"", "sty", "lut", "mar", "kwi", "maj", "cze", "lip", "sie", "wrz", "paź", "lis", "gru"},
  60. monthsNarrow: []string{"", "s", "l", "m", "k", "m", "c", "l", "s", "w", "p", "l", "g"},
  61. monthsWide: []string{"", "stycznia", "lutego", "marca", "kwietnia", "maja", "czerwca", "lipca", "sierpnia", "września", "października", "listopada", "grudnia"},
  62. daysAbbreviated: []string{"niedz.", "pon.", "wt.", "śr.", "czw.", "pt.", "sob."},
  63. daysNarrow: []string{"N", "P", "W", "Ś", "C", "P", "S"},
  64. daysShort: []string{"nie", "pon", "wto", "śro", "czw", "pią", "sob"},
  65. daysWide: []string{"niedziela", "poniedziałek", "wtorek", "środa", "czwartek", "piątek", "sobota"},
  66. periodsAbbreviated: []string{"AM", "PM"},
  67. periodsNarrow: []string{"a", "p"},
  68. periodsWide: []string{"AM", "PM"},
  69. erasAbbreviated: []string{"p.n.e.", "n.e."},
  70. erasNarrow: []string{"", ""},
  71. erasWide: []string{"p.n.e.", "n.e."},
  72. timezones: map[string]string{"AEST": "Czas standardowy wschodnioaustraliski", "HAST": "Hawaje-Aleuty (czas standardowy)", "WARST": "Argentyna Zachodnia (czas letni)", "WART": "Argentyna Zachodnia (czas standardowy)", "OESZ": "Czas wschodnioeuropejski letni", "GFT": "Gujana Francuska", "MDT": "MDT", "MEZ": "Czas środkowoeuropejski standardowy", "CLT": "Chile (czas standardowy)", "HKST": "Hongkong (czas letni)", "AKST": "Alaska (czas standardowy)", "ACWDT": "Czas środkowo-zachodnioaustralijski letni", "ECT": "Ekwador", "ADT": "Czas atlantycki letni", "WAST": "Czas zachodnioafrykański letni", "AKDT": "Alaska (czas letni)", "PST": "Czas pacyficzny standardowy", "WESZ": "Czas zachodnioeuropejski letni", "COT": "Kolumbia (czas standardowy)", "GMT": "Czas uniwersalny", "WITA": "Indonezja Środkowa", "TMT": "Turkmenistan (czas standardowy)", "TMST": "Turkmenistan (czas letni)", "CDT": "Czas środkowoamerykański letni", "CHAST": "Chatham (czas standardowy)", "MYT": "Malezja", "CST": "Czas środkowoamerykański standardowy", "NZST": "Nowa Zelandia (czas standardowy)", "NZDT": "Nowa Zelandia (czas letni)", "ChST": "Czamorro", "WAT": "Czas zachodnioafrykański standardowy", "JST": "Japonia (czas standardowy)", "BOT": "Boliwia", "UYT": "Urugwaj (czas standardowy)", "AEDT": "Czas wschodnioaustraliski letni", "COST": "Kolumbia (czas letni)", "AST": "Czas standardowy atlantycki", "WIT": "Indonezja Wschodnia", "GYT": "Gujana", "CHADT": "Chatham (czas letni)", "SAST": "Czas południowoafrykański", "IST": "Czas indyjski", "MST": "MST", "ACDT": "Czas środkowoaustralijski letni", "∅∅∅": "Czas amazoński letni", "LHST": "Lord Howe (czas standardowy)", "MESZ": "Czas środkowoeuropejski letni", "ARST": "Argentyna (czas letni)", "JDT": "Japonia (czas letni)", "BT": "Bhutan", "HNT": "Nowa Fundlandia (czas standardowy)", "ART": "Argentyna (czas standardowy)", "UYST": "Urugwaj (czas letni)", "ACWST": "Czas środkowo-zachodnioaustralijski standardowy", "EST": "Czas wschodnioamerykański standardowy", "ACST": "Czas środkowoaustralijski standardowy", "CAT": "Czas środkowoafrykański", "HKT": "Hongkong (czas standardowy)", "WIB": "Indonezja Zachodnia", "PDT": "Czas pacyficzny letni", "AWDT": "Czas zachodnioaustralijski letni", "SRT": "Surinam", "SGT": "Singapur", "CLST": "Chile (czas letni)", "HADT": "Hawaje-Aleuty (czas letni)", "HAT": "Nowa Fundlandia (czas letni)", "EAT": "Czas wschodnioafrykański", "LHDT": "Lord Howe (czas letni)", "WEZ": "Czas zachodnioeuropejski standardowy", "VET": "Wenezuela", "OEZ": "Czas wschodnioeuropejski standardowy", "AWST": "Czas zachodnioaustralijski standardowy", "EDT": "Czas wschodnioamerykański letni"},
  73. }
  74. }
  75. // Locale returns the current translators string locale
  76. func (pl *pl_PL) Locale() string {
  77. return pl.locale
  78. }
  79. // PluralsCardinal returns the list of cardinal plural rules associated with 'pl_PL'
  80. func (pl *pl_PL) PluralsCardinal() []locales.PluralRule {
  81. return pl.pluralsCardinal
  82. }
  83. // PluralsOrdinal returns the list of ordinal plural rules associated with 'pl_PL'
  84. func (pl *pl_PL) PluralsOrdinal() []locales.PluralRule {
  85. return pl.pluralsOrdinal
  86. }
  87. // PluralsRange returns the list of range plural rules associated with 'pl_PL'
  88. func (pl *pl_PL) PluralsRange() []locales.PluralRule {
  89. return pl.pluralsRange
  90. }
  91. // CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'pl_PL'
  92. func (pl *pl_PL) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
  93. n := math.Abs(num)
  94. i := int64(n)
  95. iMod10 := i % 10
  96. iMod100 := i % 100
  97. if i == 1 && v == 0 {
  98. return locales.PluralRuleOne
  99. } else if v == 0 && iMod10 >= 2 && iMod10 <= 4 && iMod100 < 12 && iMod100 > 14 {
  100. return locales.PluralRuleFew
  101. } else if (v == 0 && i != 1 && iMod10 >= 0 && iMod10 <= 1) || (v == 0 && iMod10 >= 5 && iMod10 <= 9) || (v == 0 && iMod100 >= 12 && iMod100 <= 14) {
  102. return locales.PluralRuleMany
  103. }
  104. return locales.PluralRuleOther
  105. }
  106. // OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'pl_PL'
  107. func (pl *pl_PL) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
  108. return locales.PluralRuleOther
  109. }
  110. // RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'pl_PL'
  111. func (pl *pl_PL) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
  112. start := pl.CardinalPluralRule(num1, v1)
  113. end := pl.CardinalPluralRule(num2, v2)
  114. if start == locales.PluralRuleOne && end == locales.PluralRuleFew {
  115. return locales.PluralRuleFew
  116. } else if start == locales.PluralRuleOne && end == locales.PluralRuleMany {
  117. return locales.PluralRuleMany
  118. } else if start == locales.PluralRuleOne && end == locales.PluralRuleOther {
  119. return locales.PluralRuleOther
  120. } else if start == locales.PluralRuleFew && end == locales.PluralRuleFew {
  121. return locales.PluralRuleFew
  122. } else if start == locales.PluralRuleFew && end == locales.PluralRuleMany {
  123. return locales.PluralRuleMany
  124. } else if start == locales.PluralRuleFew && end == locales.PluralRuleOther {
  125. return locales.PluralRuleOther
  126. } else if start == locales.PluralRuleMany && end == locales.PluralRuleOne {
  127. return locales.PluralRuleOne
  128. } else if start == locales.PluralRuleMany && end == locales.PluralRuleFew {
  129. return locales.PluralRuleFew
  130. } else if start == locales.PluralRuleMany && end == locales.PluralRuleMany {
  131. return locales.PluralRuleMany
  132. } else if start == locales.PluralRuleMany && end == locales.PluralRuleOther {
  133. return locales.PluralRuleOther
  134. } else if start == locales.PluralRuleOther && end == locales.PluralRuleOne {
  135. return locales.PluralRuleOne
  136. } else if start == locales.PluralRuleOther && end == locales.PluralRuleFew {
  137. return locales.PluralRuleFew
  138. } else if start == locales.PluralRuleOther && end == locales.PluralRuleMany {
  139. return locales.PluralRuleMany
  140. }
  141. return locales.PluralRuleOther
  142. }
  143. // MonthAbbreviated returns the locales abbreviated month given the 'month' provided
  144. func (pl *pl_PL) MonthAbbreviated(month time.Month) string {
  145. return pl.monthsAbbreviated[month]
  146. }
  147. // MonthsAbbreviated returns the locales abbreviated months
  148. func (pl *pl_PL) MonthsAbbreviated() []string {
  149. return pl.monthsAbbreviated[1:]
  150. }
  151. // MonthNarrow returns the locales narrow month given the 'month' provided
  152. func (pl *pl_PL) MonthNarrow(month time.Month) string {
  153. return pl.monthsNarrow[month]
  154. }
  155. // MonthsNarrow returns the locales narrow months
  156. func (pl *pl_PL) MonthsNarrow() []string {
  157. return pl.monthsNarrow[1:]
  158. }
  159. // MonthWide returns the locales wide month given the 'month' provided
  160. func (pl *pl_PL) MonthWide(month time.Month) string {
  161. return pl.monthsWide[month]
  162. }
  163. // MonthsWide returns the locales wide months
  164. func (pl *pl_PL) MonthsWide() []string {
  165. return pl.monthsWide[1:]
  166. }
  167. // WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
  168. func (pl *pl_PL) WeekdayAbbreviated(weekday time.Weekday) string {
  169. return pl.daysAbbreviated[weekday]
  170. }
  171. // WeekdaysAbbreviated returns the locales abbreviated weekdays
  172. func (pl *pl_PL) WeekdaysAbbreviated() []string {
  173. return pl.daysAbbreviated
  174. }
  175. // WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
  176. func (pl *pl_PL) WeekdayNarrow(weekday time.Weekday) string {
  177. return pl.daysNarrow[weekday]
  178. }
  179. // WeekdaysNarrow returns the locales narrow weekdays
  180. func (pl *pl_PL) WeekdaysNarrow() []string {
  181. return pl.daysNarrow
  182. }
  183. // WeekdayShort returns the locales short weekday given the 'weekday' provided
  184. func (pl *pl_PL) WeekdayShort(weekday time.Weekday) string {
  185. return pl.daysShort[weekday]
  186. }
  187. // WeekdaysShort returns the locales short weekdays
  188. func (pl *pl_PL) WeekdaysShort() []string {
  189. return pl.daysShort
  190. }
  191. // WeekdayWide returns the locales wide weekday given the 'weekday' provided
  192. func (pl *pl_PL) WeekdayWide(weekday time.Weekday) string {
  193. return pl.daysWide[weekday]
  194. }
  195. // WeekdaysWide returns the locales wide weekdays
  196. func (pl *pl_PL) WeekdaysWide() []string {
  197. return pl.daysWide
  198. }
  199. // FmtNumber returns 'num' with digits/precision of 'v' for 'pl_PL' and handles both Whole and Real numbers based on 'v'
  200. func (pl *pl_PL) FmtNumber(num float64, v uint64) string {
  201. s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
  202. l := len(s) + 2 + 2*len(s[:len(s)-int(v)-1])/3
  203. count := 0
  204. inWhole := v == 0
  205. b := make([]byte, 0, l)
  206. for i := len(s) - 1; i >= 0; i-- {
  207. if s[i] == '.' {
  208. b = append(b, pl.decimal[0])
  209. inWhole = true
  210. continue
  211. }
  212. if inWhole {
  213. if count == 3 {
  214. for j := len(pl.group) - 1; j >= 0; j-- {
  215. b = append(b, pl.group[j])
  216. }
  217. count = 1
  218. } else {
  219. count++
  220. }
  221. }
  222. b = append(b, s[i])
  223. }
  224. if num < 0 {
  225. b = append(b, pl.minus[0])
  226. }
  227. // reverse
  228. for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
  229. b[i], b[j] = b[j], b[i]
  230. }
  231. return string(b)
  232. }
  233. // FmtPercent returns 'num' with digits/precision of 'v' for 'pl_PL' and handles both Whole and Real numbers based on 'v'
  234. // NOTE: 'num' passed into FmtPercent is assumed to be in percent already
  235. func (pl *pl_PL) FmtPercent(num float64, v uint64) string {
  236. s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
  237. l := len(s) + 3
  238. b := make([]byte, 0, l)
  239. for i := len(s) - 1; i >= 0; i-- {
  240. if s[i] == '.' {
  241. b = append(b, pl.decimal[0])
  242. continue
  243. }
  244. b = append(b, s[i])
  245. }
  246. if num < 0 {
  247. b = append(b, pl.minus[0])
  248. }
  249. // reverse
  250. for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
  251. b[i], b[j] = b[j], b[i]
  252. }
  253. b = append(b, pl.percent...)
  254. return string(b)
  255. }
  256. // FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'pl_PL'
  257. func (pl *pl_PL) FmtCurrency(num float64, v uint64, currency currency.Type) string {
  258. s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
  259. symbol := pl.currencies[currency]
  260. l := len(s) + len(symbol) + 4 + 2*len(s[:len(s)-int(v)-1])/3
  261. count := 0
  262. inWhole := v == 0
  263. b := make([]byte, 0, l)
  264. for i := len(s) - 1; i >= 0; i-- {
  265. if s[i] == '.' {
  266. b = append(b, pl.decimal[0])
  267. inWhole = true
  268. continue
  269. }
  270. if inWhole {
  271. if count == 3 {
  272. for j := len(pl.group) - 1; j >= 0; j-- {
  273. b = append(b, pl.group[j])
  274. }
  275. count = 1
  276. } else {
  277. count++
  278. }
  279. }
  280. b = append(b, s[i])
  281. }
  282. if num < 0 {
  283. b = append(b, pl.minus[0])
  284. }
  285. // reverse
  286. for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
  287. b[i], b[j] = b[j], b[i]
  288. }
  289. if int(v) < 2 {
  290. if v == 0 {
  291. b = append(b, pl.decimal...)
  292. }
  293. for i := 0; i < 2-int(v); i++ {
  294. b = append(b, '0')
  295. }
  296. }
  297. b = append(b, pl.currencyPositiveSuffix...)
  298. b = append(b, symbol...)
  299. return string(b)
  300. }
  301. // FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'pl_PL'
  302. // in accounting notation.
  303. func (pl *pl_PL) FmtAccounting(num float64, v uint64, currency currency.Type) string {
  304. s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
  305. symbol := pl.currencies[currency]
  306. l := len(s) + len(symbol) + 6 + 2*len(s[:len(s)-int(v)-1])/3
  307. count := 0
  308. inWhole := v == 0
  309. b := make([]byte, 0, l)
  310. for i := len(s) - 1; i >= 0; i-- {
  311. if s[i] == '.' {
  312. b = append(b, pl.decimal[0])
  313. inWhole = true
  314. continue
  315. }
  316. if inWhole {
  317. if count == 3 {
  318. for j := len(pl.group) - 1; j >= 0; j-- {
  319. b = append(b, pl.group[j])
  320. }
  321. count = 1
  322. } else {
  323. count++
  324. }
  325. }
  326. b = append(b, s[i])
  327. }
  328. if num < 0 {
  329. b = append(b, pl.currencyNegativePrefix[0])
  330. }
  331. // reverse
  332. for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
  333. b[i], b[j] = b[j], b[i]
  334. }
  335. if int(v) < 2 {
  336. if v == 0 {
  337. b = append(b, pl.decimal...)
  338. }
  339. for i := 0; i < 2-int(v); i++ {
  340. b = append(b, '0')
  341. }
  342. }
  343. if num < 0 {
  344. b = append(b, pl.currencyNegativeSuffix...)
  345. b = append(b, symbol...)
  346. } else {
  347. b = append(b, pl.currencyPositiveSuffix...)
  348. b = append(b, symbol...)
  349. }
  350. return string(b)
  351. }
  352. // FmtDateShort returns the short date representation of 't' for 'pl_PL'
  353. func (pl *pl_PL) FmtDateShort(t time.Time) string {
  354. b := make([]byte, 0, 32)
  355. if t.Day() < 10 {
  356. b = append(b, '0')
  357. }
  358. b = strconv.AppendInt(b, int64(t.Day()), 10)
  359. b = append(b, []byte{0x2e}...)
  360. if t.Month() < 10 {
  361. b = append(b, '0')
  362. }
  363. b = strconv.AppendInt(b, int64(t.Month()), 10)
  364. b = append(b, []byte{0x2e}...)
  365. b = strconv.AppendInt(b, int64(t.Year()), 10)
  366. return string(b)
  367. }
  368. // FmtDateMedium returns the medium date representation of 't' for 'pl_PL'
  369. func (pl *pl_PL) FmtDateMedium(t time.Time) string {
  370. b := make([]byte, 0, 32)
  371. if t.Day() < 10 {
  372. b = append(b, '0')
  373. }
  374. b = strconv.AppendInt(b, int64(t.Day()), 10)
  375. b = append(b, []byte{0x2e}...)
  376. if t.Month() < 10 {
  377. b = append(b, '0')
  378. }
  379. b = strconv.AppendInt(b, int64(t.Month()), 10)
  380. b = append(b, []byte{0x2e}...)
  381. b = strconv.AppendInt(b, int64(t.Year()), 10)
  382. return string(b)
  383. }
  384. // FmtDateLong returns the long date representation of 't' for 'pl_PL'
  385. func (pl *pl_PL) FmtDateLong(t time.Time) string {
  386. b := make([]byte, 0, 32)
  387. b = strconv.AppendInt(b, int64(t.Day()), 10)
  388. b = append(b, []byte{0x20}...)
  389. b = append(b, pl.monthsWide[t.Month()]...)
  390. b = append(b, []byte{0x20}...)
  391. b = strconv.AppendInt(b, int64(t.Year()), 10)
  392. return string(b)
  393. }
  394. // FmtDateFull returns the full date representation of 't' for 'pl_PL'
  395. func (pl *pl_PL) FmtDateFull(t time.Time) string {
  396. b := make([]byte, 0, 32)
  397. b = append(b, pl.daysWide[t.Weekday()]...)
  398. b = append(b, []byte{0x2c, 0x20}...)
  399. b = strconv.AppendInt(b, int64(t.Day()), 10)
  400. b = append(b, []byte{0x20}...)
  401. b = append(b, pl.monthsWide[t.Month()]...)
  402. b = append(b, []byte{0x20}...)
  403. b = strconv.AppendInt(b, int64(t.Year()), 10)
  404. return string(b)
  405. }
  406. // FmtTimeShort returns the short time representation of 't' for 'pl_PL'
  407. func (pl *pl_PL) FmtTimeShort(t time.Time) string {
  408. b := make([]byte, 0, 32)
  409. if t.Hour() < 10 {
  410. b = append(b, '0')
  411. }
  412. b = strconv.AppendInt(b, int64(t.Hour()), 10)
  413. b = append(b, pl.timeSeparator...)
  414. if t.Minute() < 10 {
  415. b = append(b, '0')
  416. }
  417. b = strconv.AppendInt(b, int64(t.Minute()), 10)
  418. return string(b)
  419. }
  420. // FmtTimeMedium returns the medium time representation of 't' for 'pl_PL'
  421. func (pl *pl_PL) FmtTimeMedium(t time.Time) string {
  422. b := make([]byte, 0, 32)
  423. if t.Hour() < 10 {
  424. b = append(b, '0')
  425. }
  426. b = strconv.AppendInt(b, int64(t.Hour()), 10)
  427. b = append(b, pl.timeSeparator...)
  428. if t.Minute() < 10 {
  429. b = append(b, '0')
  430. }
  431. b = strconv.AppendInt(b, int64(t.Minute()), 10)
  432. b = append(b, pl.timeSeparator...)
  433. if t.Second() < 10 {
  434. b = append(b, '0')
  435. }
  436. b = strconv.AppendInt(b, int64(t.Second()), 10)
  437. return string(b)
  438. }
  439. // FmtTimeLong returns the long time representation of 't' for 'pl_PL'
  440. func (pl *pl_PL) FmtTimeLong(t time.Time) string {
  441. b := make([]byte, 0, 32)
  442. if t.Hour() < 10 {
  443. b = append(b, '0')
  444. }
  445. b = strconv.AppendInt(b, int64(t.Hour()), 10)
  446. b = append(b, pl.timeSeparator...)
  447. if t.Minute() < 10 {
  448. b = append(b, '0')
  449. }
  450. b = strconv.AppendInt(b, int64(t.Minute()), 10)
  451. b = append(b, pl.timeSeparator...)
  452. if t.Second() < 10 {
  453. b = append(b, '0')
  454. }
  455. b = strconv.AppendInt(b, int64(t.Second()), 10)
  456. b = append(b, []byte{0x20}...)
  457. tz, _ := t.Zone()
  458. b = append(b, tz...)
  459. return string(b)
  460. }
  461. // FmtTimeFull returns the full time representation of 't' for 'pl_PL'
  462. func (pl *pl_PL) FmtTimeFull(t time.Time) string {
  463. b := make([]byte, 0, 32)
  464. if t.Hour() < 10 {
  465. b = append(b, '0')
  466. }
  467. b = strconv.AppendInt(b, int64(t.Hour()), 10)
  468. b = append(b, pl.timeSeparator...)
  469. if t.Minute() < 10 {
  470. b = append(b, '0')
  471. }
  472. b = strconv.AppendInt(b, int64(t.Minute()), 10)
  473. b = append(b, pl.timeSeparator...)
  474. if t.Second() < 10 {
  475. b = append(b, '0')
  476. }
  477. b = strconv.AppendInt(b, int64(t.Second()), 10)
  478. b = append(b, []byte{0x20}...)
  479. tz, _ := t.Zone()
  480. if btz, ok := pl.timezones[tz]; ok {
  481. b = append(b, btz...)
  482. } else {
  483. b = append(b, tz...)
  484. }
  485. return string(b)
  486. }