en_NL.go 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624
  1. package en_NL
  2. import (
  3. "math"
  4. "strconv"
  5. "time"
  6. "github.com/go-playground/locales"
  7. "github.com/go-playground/locales/currency"
  8. )
  9. type en_NL struct {
  10. locale string
  11. pluralsCardinal []locales.PluralRule
  12. pluralsOrdinal []locales.PluralRule
  13. pluralsRange []locales.PluralRule
  14. decimal string
  15. group string
  16. minus string
  17. percent string
  18. perMille string
  19. timeSeparator string
  20. inifinity string
  21. currencies []string // idx = enum of currency code
  22. currencyPositivePrefix string
  23. 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 'en_NL' locale
  42. func New() locales.Translator {
  43. return &en_NL{
  44. locale: "en_NL",
  45. pluralsCardinal: []locales.PluralRule{2, 6},
  46. pluralsOrdinal: []locales.PluralRule{2, 3, 4, 6},
  47. pluralsRange: []locales.PluralRule{6},
  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", "BYN", "BYR", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "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", "STN", "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. currencyPositivePrefix: " ",
  57. currencyNegativePrefix: "( ",
  58. currencyNegativeSuffix: ")",
  59. monthsAbbreviated: []string{"", "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"},
  60. monthsNarrow: []string{"", "J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"},
  61. monthsWide: []string{"", "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"},
  62. daysAbbreviated: []string{"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"},
  63. daysNarrow: []string{"S", "M", "T", "W", "T", "F", "S"},
  64. daysShort: []string{"Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"},
  65. daysWide: []string{"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"},
  66. periodsAbbreviated: []string{"am", "pm"},
  67. periodsNarrow: []string{"a", "p"},
  68. periodsWide: []string{"am", "pm"},
  69. erasAbbreviated: []string{"BC", "AD"},
  70. erasNarrow: []string{"B", "A"},
  71. erasWide: []string{"Before Christ", "Anno Domini"},
  72. timezones: map[string]string{"WITA": "Central Indonesia Time", "PST": "Pacific Standard Time", "JDT": "Japan Daylight Time", "LHST": "Lord Howe Standard Time", "HAT": "Newfoundland Daylight Time", "TMST": "Turkmenistan Summer Time", "CHADT": "Chatham Daylight Time", "PDT": "Pacific Daylight Time", "NZDT": "New Zealand Daylight Time", "AKST": "Alaska Standard Time", "HEEG": "East Greenland Summer Time", "HNOG": "West Greenland Standard Time", "SRT": "Suriname Time", "CDT": "Central Daylight Time", "∅∅∅": "Amazon Summer Time", "OEZ": "Eastern European Standard Time", "CST": "Central Standard Time", "AKDT": "Alaska Daylight Time", "HEOG": "West Greenland Summer Time", "MESZ": "Central European Summer Time", "TMT": "Turkmenistan Standard Time", "CLST": "Chile Summer Time", "HKT": "Hong Kong Standard Time", "HECU": "Cuba Daylight Time", "HNPMX": "Mexican Pacific Standard Time", "AWDT": "Australian Western Daylight Time", "WIB": "Western Indonesia Time", "WEZ": "Western European Standard Time", "BOT": "Bolivia Time", "MDT": "Macau Summer Time", "EAT": "East Africa Time", "NZST": "New Zealand Standard Time", "HKST": "Hong Kong Summer Time", "HNT": "Newfoundland Standard Time", "GFT": "French Guiana Time", "JST": "Japan Standard Time", "WESZ": "Western European Summer Time", "HNEG": "East Greenland Standard Time", "CHAST": "Chatham Standard Time", "ADT": "Atlantic Daylight Time", "ECT": "Ecuador Time", "MST": "Macau Standard Time", "UYST": "Uruguay Summer Time", "AWST": "Australian Western Standard Time", "HNPM": "St. Pierre & Miquelon Standard Time", "HEPM": "St. Pierre & Miquelon Daylight Time", "OESZ": "Eastern European Summer Time", "HAST": "Hawaii-Aleutian Standard Time", "MYT": "Malaysia Time", "ACWDT": "Australian Central Western Daylight Time", "HADT": "Hawaii-Aleutian Daylight Time", "SAST": "South Africa Standard Time", "ChST": "Chamorro Standard Time", "ACST": "Australian Central Standard Time", "MEZ": "Central European Standard Time", "WARST": "Western Argentina Summer Time", "ARST": "Argentina Summer Time", "UYT": "Uruguay Standard Time", "SGT": "Singapore Standard Time", "COT": "Colombia Standard Time", "GYT": "Guyana Time", "HNCU": "Cuba Standard Time", "AEDT": "Australian Eastern Daylight Time", "WAT": "West Africa Standard Time", "WAST": "West Africa Summer Time", "BT": "Bhutan Time", "EDT": "Eastern Daylight Time", "HNNOMX": "Northwest Mexico Standard Time", "CLT": "Chile Standard Time", "ACDT": "Australian Central Daylight Time", "EST": "Eastern Standard Time", "IST": "India Standard Time", "CAT": "Central Africa Time", "HEPMX": "Mexican Pacific Daylight Time", "AST": "Atlantic Standard Time", "ACWST": "Australian Central Western Standard Time", "WIT": "Eastern Indonesia Time", "COST": "Colombia Summer Time", "GMT": "Greenwich Mean Time", "AEST": "Australian Eastern Standard Time", "HENOMX": "Northwest Mexico Daylight Time", "ART": "Argentina Standard Time", "VET": "Venezuela Time", "LHDT": "Lord Howe Daylight Time", "WART": "Western Argentina Standard Time"},
  73. }
  74. }
  75. // Locale returns the current translators string locale
  76. func (en *en_NL) Locale() string {
  77. return en.locale
  78. }
  79. // PluralsCardinal returns the list of cardinal plural rules associated with 'en_NL'
  80. func (en *en_NL) PluralsCardinal() []locales.PluralRule {
  81. return en.pluralsCardinal
  82. }
  83. // PluralsOrdinal returns the list of ordinal plural rules associated with 'en_NL'
  84. func (en *en_NL) PluralsOrdinal() []locales.PluralRule {
  85. return en.pluralsOrdinal
  86. }
  87. // PluralsRange returns the list of range plural rules associated with 'en_NL'
  88. func (en *en_NL) PluralsRange() []locales.PluralRule {
  89. return en.pluralsRange
  90. }
  91. // CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'en_NL'
  92. func (en *en_NL) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
  93. n := math.Abs(num)
  94. i := int64(n)
  95. if i == 1 && v == 0 {
  96. return locales.PluralRuleOne
  97. }
  98. return locales.PluralRuleOther
  99. }
  100. // OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'en_NL'
  101. func (en *en_NL) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
  102. n := math.Abs(num)
  103. nMod10 := math.Mod(n, 10)
  104. nMod100 := math.Mod(n, 100)
  105. if nMod10 == 1 && nMod100 != 11 {
  106. return locales.PluralRuleOne
  107. } else if nMod10 == 2 && nMod100 != 12 {
  108. return locales.PluralRuleTwo
  109. } else if nMod10 == 3 && nMod100 != 13 {
  110. return locales.PluralRuleFew
  111. }
  112. return locales.PluralRuleOther
  113. }
  114. // RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'en_NL'
  115. func (en *en_NL) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
  116. return locales.PluralRuleOther
  117. }
  118. // MonthAbbreviated returns the locales abbreviated month given the 'month' provided
  119. func (en *en_NL) MonthAbbreviated(month time.Month) string {
  120. return en.monthsAbbreviated[month]
  121. }
  122. // MonthsAbbreviated returns the locales abbreviated months
  123. func (en *en_NL) MonthsAbbreviated() []string {
  124. return en.monthsAbbreviated[1:]
  125. }
  126. // MonthNarrow returns the locales narrow month given the 'month' provided
  127. func (en *en_NL) MonthNarrow(month time.Month) string {
  128. return en.monthsNarrow[month]
  129. }
  130. // MonthsNarrow returns the locales narrow months
  131. func (en *en_NL) MonthsNarrow() []string {
  132. return en.monthsNarrow[1:]
  133. }
  134. // MonthWide returns the locales wide month given the 'month' provided
  135. func (en *en_NL) MonthWide(month time.Month) string {
  136. return en.monthsWide[month]
  137. }
  138. // MonthsWide returns the locales wide months
  139. func (en *en_NL) MonthsWide() []string {
  140. return en.monthsWide[1:]
  141. }
  142. // WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
  143. func (en *en_NL) WeekdayAbbreviated(weekday time.Weekday) string {
  144. return en.daysAbbreviated[weekday]
  145. }
  146. // WeekdaysAbbreviated returns the locales abbreviated weekdays
  147. func (en *en_NL) WeekdaysAbbreviated() []string {
  148. return en.daysAbbreviated
  149. }
  150. // WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
  151. func (en *en_NL) WeekdayNarrow(weekday time.Weekday) string {
  152. return en.daysNarrow[weekday]
  153. }
  154. // WeekdaysNarrow returns the locales narrow weekdays
  155. func (en *en_NL) WeekdaysNarrow() []string {
  156. return en.daysNarrow
  157. }
  158. // WeekdayShort returns the locales short weekday given the 'weekday' provided
  159. func (en *en_NL) WeekdayShort(weekday time.Weekday) string {
  160. return en.daysShort[weekday]
  161. }
  162. // WeekdaysShort returns the locales short weekdays
  163. func (en *en_NL) WeekdaysShort() []string {
  164. return en.daysShort
  165. }
  166. // WeekdayWide returns the locales wide weekday given the 'weekday' provided
  167. func (en *en_NL) WeekdayWide(weekday time.Weekday) string {
  168. return en.daysWide[weekday]
  169. }
  170. // WeekdaysWide returns the locales wide weekdays
  171. func (en *en_NL) WeekdaysWide() []string {
  172. return en.daysWide
  173. }
  174. // Decimal returns the decimal point of number
  175. func (en *en_NL) Decimal() string {
  176. return en.decimal
  177. }
  178. // Group returns the group of number
  179. func (en *en_NL) Group() string {
  180. return en.group
  181. }
  182. // Group returns the minus sign of number
  183. func (en *en_NL) Minus() string {
  184. return en.minus
  185. }
  186. // FmtNumber returns 'num' with digits/precision of 'v' for 'en_NL' and handles both Whole and Real numbers based on 'v'
  187. func (en *en_NL) FmtNumber(num float64, v uint64) string {
  188. s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
  189. l := len(s) + 2 + 1*len(s[:len(s)-int(v)-1])/3
  190. count := 0
  191. inWhole := v == 0
  192. b := make([]byte, 0, l)
  193. for i := len(s) - 1; i >= 0; i-- {
  194. if s[i] == '.' {
  195. b = append(b, en.decimal[0])
  196. inWhole = true
  197. continue
  198. }
  199. if inWhole {
  200. if count == 3 {
  201. b = append(b, en.group[0])
  202. count = 1
  203. } else {
  204. count++
  205. }
  206. }
  207. b = append(b, s[i])
  208. }
  209. if num < 0 {
  210. b = append(b, en.minus[0])
  211. }
  212. // reverse
  213. for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
  214. b[i], b[j] = b[j], b[i]
  215. }
  216. return string(b)
  217. }
  218. // FmtPercent returns 'num' with digits/precision of 'v' for 'en_NL' and handles both Whole and Real numbers based on 'v'
  219. // NOTE: 'num' passed into FmtPercent is assumed to be in percent already
  220. func (en *en_NL) FmtPercent(num float64, v uint64) string {
  221. s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
  222. l := len(s) + 3
  223. b := make([]byte, 0, l)
  224. for i := len(s) - 1; i >= 0; i-- {
  225. if s[i] == '.' {
  226. b = append(b, en.decimal[0])
  227. continue
  228. }
  229. b = append(b, s[i])
  230. }
  231. if num < 0 {
  232. b = append(b, en.minus[0])
  233. }
  234. // reverse
  235. for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
  236. b[i], b[j] = b[j], b[i]
  237. }
  238. b = append(b, en.percent...)
  239. return string(b)
  240. }
  241. // FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'en_NL'
  242. func (en *en_NL) FmtCurrency(num float64, v uint64, currency currency.Type) string {
  243. s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
  244. symbol := en.currencies[currency]
  245. l := len(s) + len(symbol) + 4 + 1*len(s[:len(s)-int(v)-1])/3
  246. count := 0
  247. inWhole := v == 0
  248. b := make([]byte, 0, l)
  249. for i := len(s) - 1; i >= 0; i-- {
  250. if s[i] == '.' {
  251. b = append(b, en.decimal[0])
  252. inWhole = true
  253. continue
  254. }
  255. if inWhole {
  256. if count == 3 {
  257. b = append(b, en.group[0])
  258. count = 1
  259. } else {
  260. count++
  261. }
  262. }
  263. b = append(b, s[i])
  264. }
  265. for j := len(symbol) - 1; j >= 0; j-- {
  266. b = append(b, symbol[j])
  267. }
  268. for j := len(en.currencyPositivePrefix) - 1; j >= 0; j-- {
  269. b = append(b, en.currencyPositivePrefix[j])
  270. }
  271. if num < 0 {
  272. b = append(b, en.minus[0])
  273. }
  274. // reverse
  275. for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
  276. b[i], b[j] = b[j], b[i]
  277. }
  278. if int(v) < 2 {
  279. if v == 0 {
  280. b = append(b, en.decimal...)
  281. }
  282. for i := 0; i < 2-int(v); i++ {
  283. b = append(b, '0')
  284. }
  285. }
  286. return string(b)
  287. }
  288. // FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'en_NL'
  289. // in accounting notation.
  290. func (en *en_NL) FmtAccounting(num float64, v uint64, currency currency.Type) string {
  291. s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
  292. symbol := en.currencies[currency]
  293. l := len(s) + len(symbol) + 6 + 1*len(s[:len(s)-int(v)-1])/3
  294. count := 0
  295. inWhole := v == 0
  296. b := make([]byte, 0, l)
  297. for i := len(s) - 1; i >= 0; i-- {
  298. if s[i] == '.' {
  299. b = append(b, en.decimal[0])
  300. inWhole = true
  301. continue
  302. }
  303. if inWhole {
  304. if count == 3 {
  305. b = append(b, en.group[0])
  306. count = 1
  307. } else {
  308. count++
  309. }
  310. }
  311. b = append(b, s[i])
  312. }
  313. if num < 0 {
  314. for j := len(symbol) - 1; j >= 0; j-- {
  315. b = append(b, symbol[j])
  316. }
  317. for j := len(en.currencyNegativePrefix) - 1; j >= 0; j-- {
  318. b = append(b, en.currencyNegativePrefix[j])
  319. }
  320. } else {
  321. for j := len(symbol) - 1; j >= 0; j-- {
  322. b = append(b, symbol[j])
  323. }
  324. for j := len(en.currencyPositivePrefix) - 1; j >= 0; j-- {
  325. b = append(b, en.currencyPositivePrefix[j])
  326. }
  327. }
  328. // reverse
  329. for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
  330. b[i], b[j] = b[j], b[i]
  331. }
  332. if int(v) < 2 {
  333. if v == 0 {
  334. b = append(b, en.decimal...)
  335. }
  336. for i := 0; i < 2-int(v); i++ {
  337. b = append(b, '0')
  338. }
  339. }
  340. if num < 0 {
  341. b = append(b, en.currencyNegativeSuffix...)
  342. }
  343. return string(b)
  344. }
  345. // FmtDateShort returns the short date representation of 't' for 'en_NL'
  346. func (en *en_NL) FmtDateShort(t time.Time) string {
  347. b := make([]byte, 0, 32)
  348. b = strconv.AppendInt(b, int64(t.Month()), 10)
  349. b = append(b, []byte{0x2f}...)
  350. b = strconv.AppendInt(b, int64(t.Day()), 10)
  351. b = append(b, []byte{0x2f}...)
  352. if t.Year() > 9 {
  353. b = append(b, strconv.Itoa(t.Year())[2:]...)
  354. } else {
  355. b = append(b, strconv.Itoa(t.Year())[1:]...)
  356. }
  357. return string(b)
  358. }
  359. // FmtDateMedium returns the medium date representation of 't' for 'en_NL'
  360. func (en *en_NL) FmtDateMedium(t time.Time) string {
  361. b := make([]byte, 0, 32)
  362. b = append(b, en.monthsAbbreviated[t.Month()]...)
  363. b = append(b, []byte{0x20}...)
  364. b = strconv.AppendInt(b, int64(t.Day()), 10)
  365. b = append(b, []byte{0x2c, 0x20}...)
  366. if t.Year() > 0 {
  367. b = strconv.AppendInt(b, int64(t.Year()), 10)
  368. } else {
  369. b = strconv.AppendInt(b, int64(-t.Year()), 10)
  370. }
  371. return string(b)
  372. }
  373. // FmtDateLong returns the long date representation of 't' for 'en_NL'
  374. func (en *en_NL) FmtDateLong(t time.Time) string {
  375. b := make([]byte, 0, 32)
  376. b = append(b, en.monthsWide[t.Month()]...)
  377. b = append(b, []byte{0x20}...)
  378. b = strconv.AppendInt(b, int64(t.Day()), 10)
  379. b = append(b, []byte{0x2c, 0x20}...)
  380. if t.Year() > 0 {
  381. b = strconv.AppendInt(b, int64(t.Year()), 10)
  382. } else {
  383. b = strconv.AppendInt(b, int64(-t.Year()), 10)
  384. }
  385. return string(b)
  386. }
  387. // FmtDateFull returns the full date representation of 't' for 'en_NL'
  388. func (en *en_NL) FmtDateFull(t time.Time) string {
  389. b := make([]byte, 0, 32)
  390. b = append(b, en.daysWide[t.Weekday()]...)
  391. b = append(b, []byte{0x2c, 0x20}...)
  392. b = append(b, en.monthsWide[t.Month()]...)
  393. b = append(b, []byte{0x20}...)
  394. b = strconv.AppendInt(b, int64(t.Day()), 10)
  395. b = append(b, []byte{0x2c, 0x20}...)
  396. if t.Year() > 0 {
  397. b = strconv.AppendInt(b, int64(t.Year()), 10)
  398. } else {
  399. b = strconv.AppendInt(b, int64(-t.Year()), 10)
  400. }
  401. return string(b)
  402. }
  403. // FmtTimeShort returns the short time representation of 't' for 'en_NL'
  404. func (en *en_NL) FmtTimeShort(t time.Time) string {
  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, en.timeSeparator...)
  411. if t.Minute() < 10 {
  412. b = append(b, '0')
  413. }
  414. b = strconv.AppendInt(b, int64(t.Minute()), 10)
  415. return string(b)
  416. }
  417. // FmtTimeMedium returns the medium time representation of 't' for 'en_NL'
  418. func (en *en_NL) FmtTimeMedium(t time.Time) string {
  419. b := make([]byte, 0, 32)
  420. if t.Hour() < 10 {
  421. b = append(b, '0')
  422. }
  423. b = strconv.AppendInt(b, int64(t.Hour()), 10)
  424. b = append(b, en.timeSeparator...)
  425. if t.Minute() < 10 {
  426. b = append(b, '0')
  427. }
  428. b = strconv.AppendInt(b, int64(t.Minute()), 10)
  429. b = append(b, en.timeSeparator...)
  430. if t.Second() < 10 {
  431. b = append(b, '0')
  432. }
  433. b = strconv.AppendInt(b, int64(t.Second()), 10)
  434. return string(b)
  435. }
  436. // FmtTimeLong returns the long time representation of 't' for 'en_NL'
  437. func (en *en_NL) FmtTimeLong(t time.Time) string {
  438. b := make([]byte, 0, 32)
  439. if t.Hour() < 10 {
  440. b = append(b, '0')
  441. }
  442. b = strconv.AppendInt(b, int64(t.Hour()), 10)
  443. b = append(b, en.timeSeparator...)
  444. if t.Minute() < 10 {
  445. b = append(b, '0')
  446. }
  447. b = strconv.AppendInt(b, int64(t.Minute()), 10)
  448. b = append(b, en.timeSeparator...)
  449. if t.Second() < 10 {
  450. b = append(b, '0')
  451. }
  452. b = strconv.AppendInt(b, int64(t.Second()), 10)
  453. b = append(b, []byte{0x20}...)
  454. tz, _ := t.Zone()
  455. b = append(b, tz...)
  456. return string(b)
  457. }
  458. // FmtTimeFull returns the full time representation of 't' for 'en_NL'
  459. func (en *en_NL) FmtTimeFull(t time.Time) string {
  460. b := make([]byte, 0, 32)
  461. if t.Hour() < 10 {
  462. b = append(b, '0')
  463. }
  464. b = strconv.AppendInt(b, int64(t.Hour()), 10)
  465. b = append(b, en.timeSeparator...)
  466. if t.Minute() < 10 {
  467. b = append(b, '0')
  468. }
  469. b = strconv.AppendInt(b, int64(t.Minute()), 10)
  470. b = append(b, en.timeSeparator...)
  471. if t.Second() < 10 {
  472. b = append(b, '0')
  473. }
  474. b = strconv.AppendInt(b, int64(t.Second()), 10)
  475. b = append(b, []byte{0x20}...)
  476. tz, _ := t.Zone()
  477. if btz, ok := en.timezones[tz]; ok {
  478. b = append(b, btz...)
  479. } else {
  480. b = append(b, tz...)
  481. }
  482. return string(b)
  483. }