8 "github.com/go-playground/locales"
9 "github.com/go-playground/locales/currency"
14 pluralsCardinal []locales.PluralRule
15 pluralsOrdinal []locales.PluralRule
16 pluralsRange []locales.PluralRule
25 currencies []string // idx = enum of currency code
26 currencyPositiveSuffix string
27 currencyNegativeSuffix string
28 monthsAbbreviated []string
31 daysAbbreviated []string
35 periodsAbbreviated []string
36 periodsNarrow []string
39 erasAbbreviated []string
42 timezones map[string]string
45 // New returns a new instance of translator for the 'nds_DE' locale
46 func New() locales.Translator {
59 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", "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"},
61 currencyPositiveSuffix: " ",
62 currencyNegativeSuffix: " ",
63 monthsAbbreviated: []string{"", "Jan.", "Feb.", "März", "Apr.", "Mai", "Juni", "Juli", "Aug.", "Sep.", "Okt.", "Nov.", "Dez."},
64 monthsNarrow: []string{"", "J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"},
65 monthsWide: []string{"", "Januaar", "Februaar", "März", "April", "Mai", "Juni", "Juli", "August", "September", "Oktover", "November", "Dezember"},
66 daysAbbreviated: []string{"Sü.", "Ma.", "Di.", "Mi.", "Du.", "Fr.", "Sa."},
67 daysNarrow: []string{"S", "M", "D", "M", "D", "F", "S"},
68 daysWide: []string{"Sünndag", "Maandag", "Dingsdag", "Middeweken", "Dunnersdag", "Freedag", "Sünnavend"},
69 periodsAbbreviated: []string{"vm", "nm"},
70 periodsWide: []string{"vm", "nm"},
71 erasAbbreviated: []string{"v.Chr.", "n.Chr."},
72 erasNarrow: []string{"vC", "nC"},
73 erasWide: []string{"vör Christus", "na Christus"},
74 timezones: map[string]string{"HEEG": "HEEG", "UYT": "UYT", "ACWST": "Westzentraalaustraalsch Standardtiet", "LHST": "LHST", "EAT": "Oostafrikaansch Tiet", "CDT": "Noordamerikaansch zentraal Summertiet", "HNT": "HNT", "HEPM": "HEPM", "BT": "BT", "ACWDT": "Westzentraalaustraalsch Summertiet", "HAST": "HAST", "AEDT": "Oostaustraalsch Summertiet", "WAST": "Westafrikaansch Summertiet", "HNEG": "HNEG", "NZDT": "NZDT", "SGT": "SGT", "HNPMX": "HNPMX", "WART": "WART", "ARST": "ARST", "HNPM": "HNPM", "HECU": "HECU", "WAT": "Westafrikaansch Standardtiet", "HKT": "HKT", "ACST": "Zentraalaustraalsch Standardtiet", "JDT": "Japaansch Summertiet", "WEZ": "Westeuropääsch Standardtiet", "HAT": "HAT", "PST": "Noordamerikaansch Pazifik-Standardtiet", "NZST": "NZST", "TMT": "TMT", "OEZ": "Oosteuropääsch Standardtiet", "AEST": "Oostaustraalsch Standardtiet", "SAST": "Söödafrikaansch Tiet", "AKST": "AKST", "WESZ": "Westeuropääsch Summertiet", "WIB": "Westindoneesch Tiet", "COT": "COT", "GYT": "GYT", "AKDT": "AKDT", "BOT": "BOT", "AWDT": "Westaustraalsch Summertiet", "LHDT": "LHDT", "JST": "Japaansch Standardtiet", "HEOG": "HEOG", "ECT": "ECT", "CHAST": "CHAST", "HNCU": "HNCU", "AWST": "Westaustraalsch Standardtiet", "WIT": "Oostindoneesch Tiet", "WARST": "WARST", "OESZ": "Oosteuropääsch Summertiet", "AST": "Noordamerikaansch Atlantik-Standardtiet", "HADT": "HADT", "MESZ": "Zentraaleuropääsch Summertiet", "EST": "Noordamerikaansch oosten Standardtiet", "HEPMX": "HEPMX", "GMT": "Gröönwisch-Welttiet", "CST": "Noordamerikaansch zentraal Standardtiet", "UYST": "UYST", "VET": "VET", "HKST": "HKST", "GFT": "GFT", "WITA": "Indoneesch Zentraaltiet", "∅∅∅": "∅∅∅", "MEZ": "Zentraaleuropääsch Standardtiet", "CLST": "CLST", "SRT": "SRT", "MST": "Noordamerikaansch Barg-Standardtiet", "MDT": "Noordamerikaansch Barg-Summertiet", "CLT": "CLT", "HNOG": "HNOG", "COST": "COST", "ACDT": "Zentraalaustraalsch Summertiet", "ChST": "ChST", "TMST": "TMST", "HNNOMX": "HNNOMX", "HENOMX": "HENOMX", "IST": "Indien-Tiet", "CAT": "Zentraalafrikaansch Tiet", "CHADT": "CHADT", "PDT": "Noordamerikaansch Pazifik-Summertiet", "MYT": "MYT", "ART": "ART", "ADT": "Noordamerikaansch Atlantik-Summertiet", "EDT": "Noordamerikaansch oosten Summertiet"},
78 // Locale returns the current translators string locale
79 func (nds *nds_DE) Locale() string {
83 // PluralsCardinal returns the list of cardinal plural rules associated with 'nds_DE'
84 func (nds *nds_DE) PluralsCardinal() []locales.PluralRule {
85 return nds.pluralsCardinal
88 // PluralsOrdinal returns the list of ordinal plural rules associated with 'nds_DE'
89 func (nds *nds_DE) PluralsOrdinal() []locales.PluralRule {
90 return nds.pluralsOrdinal
93 // PluralsRange returns the list of range plural rules associated with 'nds_DE'
94 func (nds *nds_DE) PluralsRange() []locales.PluralRule {
95 return nds.pluralsRange
98 // CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'nds_DE'
99 func (nds *nds_DE) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
100 return locales.PluralRuleUnknown
103 // OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'nds_DE'
104 func (nds *nds_DE) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
105 return locales.PluralRuleUnknown
108 // RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'nds_DE'
109 func (nds *nds_DE) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
110 return locales.PluralRuleUnknown
113 // MonthAbbreviated returns the locales abbreviated month given the 'month' provided
114 func (nds *nds_DE) MonthAbbreviated(month time.Month) string {
115 return nds.monthsAbbreviated[month]
118 // MonthsAbbreviated returns the locales abbreviated months
119 func (nds *nds_DE) MonthsAbbreviated() []string {
120 return nds.monthsAbbreviated[1:]
123 // MonthNarrow returns the locales narrow month given the 'month' provided
124 func (nds *nds_DE) MonthNarrow(month time.Month) string {
125 return nds.monthsNarrow[month]
128 // MonthsNarrow returns the locales narrow months
129 func (nds *nds_DE) MonthsNarrow() []string {
130 return nds.monthsNarrow[1:]
133 // MonthWide returns the locales wide month given the 'month' provided
134 func (nds *nds_DE) MonthWide(month time.Month) string {
135 return nds.monthsWide[month]
138 // MonthsWide returns the locales wide months
139 func (nds *nds_DE) MonthsWide() []string {
140 return nds.monthsWide[1:]
143 // WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
144 func (nds *nds_DE) WeekdayAbbreviated(weekday time.Weekday) string {
145 return nds.daysAbbreviated[weekday]
148 // WeekdaysAbbreviated returns the locales abbreviated weekdays
149 func (nds *nds_DE) WeekdaysAbbreviated() []string {
150 return nds.daysAbbreviated
153 // WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
154 func (nds *nds_DE) WeekdayNarrow(weekday time.Weekday) string {
155 return nds.daysNarrow[weekday]
158 // WeekdaysNarrow returns the locales narrow weekdays
159 func (nds *nds_DE) WeekdaysNarrow() []string {
160 return nds.daysNarrow
163 // WeekdayShort returns the locales short weekday given the 'weekday' provided
164 func (nds *nds_DE) WeekdayShort(weekday time.Weekday) string {
165 return nds.daysShort[weekday]
168 // WeekdaysShort returns the locales short weekdays
169 func (nds *nds_DE) WeekdaysShort() []string {
173 // WeekdayWide returns the locales wide weekday given the 'weekday' provided
174 func (nds *nds_DE) WeekdayWide(weekday time.Weekday) string {
175 return nds.daysWide[weekday]
178 // WeekdaysWide returns the locales wide weekdays
179 func (nds *nds_DE) WeekdaysWide() []string {
183 // Decimal returns the decimal point of number
184 func (nds *nds_DE) Decimal() string {
188 // Group returns the group of number
189 func (nds *nds_DE) Group() string {
193 // Group returns the minus sign of number
194 func (nds *nds_DE) Minus() string {
198 // FmtNumber returns 'num' with digits/precision of 'v' for 'nds_DE' and handles both Whole and Real numbers based on 'v'
199 func (nds *nds_DE) FmtNumber(num float64, v uint64) string {
201 s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
202 l := len(s) + 2 + 1*len(s[:len(s)-int(v)-1])/3
205 b := make([]byte, 0, l)
207 for i := len(s) - 1; i >= 0; i-- {
210 b = append(b, nds.decimal[0])
217 b = append(b, nds.group[0])
228 b = append(b, nds.minus[0])
232 for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
233 b[i], b[j] = b[j], b[i]
239 // FmtPercent returns 'num' with digits/precision of 'v' for 'nds_DE' and handles both Whole and Real numbers based on 'v'
240 // NOTE: 'num' passed into FmtPercent is assumed to be in percent already
241 func (nds *nds_DE) FmtPercent(num float64, v uint64) string {
242 s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
244 b := make([]byte, 0, l)
246 for i := len(s) - 1; i >= 0; i-- {
249 b = append(b, nds.decimal[0])
257 b = append(b, nds.minus[0])
261 for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
262 b[i], b[j] = b[j], b[i]
265 b = append(b, nds.percentSuffix...)
267 b = append(b, nds.percent...)
272 // FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'nds_DE'
273 func (nds *nds_DE) FmtCurrency(num float64, v uint64, currency currency.Type) string {
275 s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
276 symbol := nds.currencies[currency]
277 l := len(s) + len(symbol) + 4 + 1*len(s[:len(s)-int(v)-1])/3
280 b := make([]byte, 0, l)
282 for i := len(s) - 1; i >= 0; i-- {
285 b = append(b, nds.decimal[0])
292 b = append(b, nds.group[0])
303 b = append(b, nds.minus[0])
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]
314 b = append(b, nds.decimal...)
317 for i := 0; i < 2-int(v); i++ {
322 b = append(b, nds.currencyPositiveSuffix...)
324 b = append(b, symbol...)
329 // FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'nds_DE'
330 // in accounting notation.
331 func (nds *nds_DE) FmtAccounting(num float64, v uint64, currency currency.Type) string {
333 s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
334 symbol := nds.currencies[currency]
335 l := len(s) + len(symbol) + 4 + 1*len(s[:len(s)-int(v)-1])/3
338 b := make([]byte, 0, l)
340 for i := len(s) - 1; i >= 0; i-- {
343 b = append(b, nds.decimal[0])
350 b = append(b, nds.group[0])
362 b = append(b, nds.minus[0])
367 for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
368 b[i], b[j] = b[j], b[i]
374 b = append(b, nds.decimal...)
377 for i := 0; i < 2-int(v); i++ {
383 b = append(b, nds.currencyNegativeSuffix...)
384 b = append(b, symbol...)
387 b = append(b, nds.currencyPositiveSuffix...)
388 b = append(b, symbol...)
394 // FmtDateShort returns the short date representation of 't' for 'nds_DE'
395 func (nds *nds_DE) FmtDateShort(t time.Time) string {
397 b := make([]byte, 0, 32)
399 b = strconv.AppendInt(b, int64(t.Day()), 10)
400 b = append(b, []byte{0x2e}...)
406 b = strconv.AppendInt(b, int64(t.Month()), 10)
408 b = append(b, []byte{0x2e}...)
411 b = append(b, strconv.Itoa(t.Year())[2:]...)
413 b = append(b, strconv.Itoa(t.Year())[1:]...)
419 // FmtDateMedium returns the medium date representation of 't' for 'nds_DE'
420 func (nds *nds_DE) FmtDateMedium(t time.Time) string {
422 b := make([]byte, 0, 32)
424 b = strconv.AppendInt(b, int64(t.Day()), 10)
425 b = append(b, []byte{0x2e, 0x20}...)
426 b = append(b, nds.monthsAbbreviated[t.Month()]...)
427 b = append(b, []byte{0x20}...)
430 b = strconv.AppendInt(b, int64(t.Year()), 10)
432 b = strconv.AppendInt(b, int64(-t.Year()), 10)
438 // FmtDateLong returns the long date representation of 't' for 'nds_DE'
439 func (nds *nds_DE) FmtDateLong(t time.Time) string {
441 b := make([]byte, 0, 32)
443 b = strconv.AppendInt(b, int64(t.Day()), 10)
444 b = append(b, []byte{0x2e, 0x20}...)
445 b = append(b, nds.monthsWide[t.Month()]...)
446 b = append(b, []byte{0x20}...)
449 b = strconv.AppendInt(b, int64(t.Year()), 10)
451 b = strconv.AppendInt(b, int64(-t.Year()), 10)
457 // FmtDateFull returns the full date representation of 't' for 'nds_DE'
458 func (nds *nds_DE) FmtDateFull(t time.Time) string {
460 b := make([]byte, 0, 32)
462 b = append(b, nds.daysWide[t.Weekday()]...)
463 b = append(b, []byte{0x2c, 0x20, 0x64, 0x65}...)
464 b = append(b, []byte{0x20}...)
465 b = strconv.AppendInt(b, int64(t.Day()), 10)
466 b = append(b, []byte{0x2e, 0x20}...)
467 b = append(b, nds.monthsWide[t.Month()]...)
468 b = append(b, []byte{0x20}...)
471 b = strconv.AppendInt(b, int64(t.Year()), 10)
473 b = strconv.AppendInt(b, int64(-t.Year()), 10)
479 // FmtTimeShort returns the short time representation of 't' for 'nds_DE'
480 func (nds *nds_DE) FmtTimeShort(t time.Time) string {
482 b := make([]byte, 0, 32)
484 b = append(b, []byte{0x4b, 0x6c}...)
485 b = append(b, []byte{0x2e, 0x20}...)
486 b = strconv.AppendInt(b, int64(t.Hour()), 10)
487 b = append(b, []byte{0x2e}...)
493 b = strconv.AppendInt(b, int64(t.Minute()), 10)
498 // FmtTimeMedium returns the medium time representation of 't' for 'nds_DE'
499 func (nds *nds_DE) FmtTimeMedium(t time.Time) string {
501 b := make([]byte, 0, 32)
503 b = append(b, []byte{0x4b, 0x6c, 0x6f, 0x63, 0x6b}...)
504 b = append(b, []byte{0x20}...)
505 b = strconv.AppendInt(b, int64(t.Hour()), 10)
506 b = append(b, []byte{0x2e}...)
512 b = strconv.AppendInt(b, int64(t.Minute()), 10)
513 b = append(b, nds.timeSeparator...)
519 b = strconv.AppendInt(b, int64(t.Second()), 10)
524 // FmtTimeLong returns the long time representation of 't' for 'nds_DE'
525 func (nds *nds_DE) FmtTimeLong(t time.Time) string {
527 b := make([]byte, 0, 32)
529 b = append(b, []byte{0x4b, 0x6c, 0x6f, 0x63, 0x6b}...)
530 b = append(b, []byte{0x20}...)
531 b = strconv.AppendInt(b, int64(t.Hour()), 10)
532 b = append(b, []byte{0x2e}...)
538 b = strconv.AppendInt(b, int64(t.Minute()), 10)
539 b = append(b, nds.timeSeparator...)
545 b = strconv.AppendInt(b, int64(t.Second()), 10)
546 b = append(b, []byte{0x20, 0x28}...)
551 b = append(b, []byte{0x29}...)
556 // FmtTimeFull returns the full time representation of 't' for 'nds_DE'
557 func (nds *nds_DE) FmtTimeFull(t time.Time) string {
559 b := make([]byte, 0, 32)
561 b = append(b, []byte{0x4b, 0x6c, 0x6f, 0x63, 0x6b}...)
562 b = append(b, []byte{0x20}...)
563 b = strconv.AppendInt(b, int64(t.Hour()), 10)
564 b = append(b, []byte{0x2e}...)
570 b = strconv.AppendInt(b, int64(t.Minute()), 10)
571 b = append(b, nds.timeSeparator...)
577 b = strconv.AppendInt(b, int64(t.Second()), 10)
578 b = append(b, []byte{0x20, 0x28}...)
582 if btz, ok := nds.timezones[tz]; ok {
583 b = append(b, btz...)
588 b = append(b, []byte{0x29}...)