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 currencyPositivePrefix string
27 currencyNegativePrefix 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 'de_AT' locale
46 func New() locales.Translator {
49 pluralsCardinal: []locales.PluralRule{2, 6},
50 pluralsOrdinal: []locales.PluralRule{6},
51 pluralsRange: []locales.PluralRule{2, 6},
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 currencyPositivePrefix: " ",
62 currencyNegativePrefix: " ",
63 monthsAbbreviated: []string{"", "Jän.", "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{"", "Jänner", "Februar", "März", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember"},
66 daysAbbreviated: []string{"So.", "Mo.", "Di.", "Mi.", "Do.", "Fr.", "Sa."},
67 daysNarrow: []string{"S", "M", "D", "M", "D", "F", "S"},
68 daysShort: []string{"So.", "Mo.", "Di.", "Mi.", "Do.", "Fr.", "Sa."},
69 daysWide: []string{"Sonntag", "Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Samstag"},
70 periodsAbbreviated: []string{"vorm.", "nachm."},
71 periodsNarrow: []string{"vm.", "nm."},
72 periodsWide: []string{"vorm.", "nachm."},
73 erasAbbreviated: []string{"v. Chr.", "n. Chr."},
74 erasNarrow: []string{"v. Chr.", "n. Chr."},
75 erasWide: []string{"v. Chr.", "n. Chr."},
76 timezones: map[string]string{"WEZ": "Westeuropäische Normalzeit", "MESZ": "Mitteleuropäische Sommerzeit", "NZST": "Neuseeland-Normalzeit", "WARST": "Westargentinische Sommerzeit", "VET": "Venezuela-Zeit", "AEST": "Ostaustralische Normalzeit", "AWDT": "Westaustralische Sommerzeit", "JST": "Japanische Normalzeit", "HNOG": "Westgrönland-Normalzeit", "HEOG": "Westgrönland-Sommerzeit", "AST": "Atlantik-Normalzeit", "AEDT": "Ostaustralische Sommerzeit", "COT": "Kolumbianische Normalzeit", "ACST": "Zentralaustralische Normalzeit", "CAT": "Zentralafrikanische Zeit", "SRT": "Suriname-Zeit", "MYT": "Malaysische Zeit", "LHST": "Lord-Howe-Normalzeit", "ART": "Argentinische Normalzeit", "COST": "Kolumbianische Sommerzeit", "EST": "Nordamerikanische Ostküsten-Normalzeit", "LHDT": "Lord-Howe-Sommerzeit", "HAT": "Neufundland-Sommerzeit", "WESZ": "Westeuropäische Sommerzeit", "CDT": "Nordamerikanische Inland-Sommerzeit", "HENOMX": "Mexiko Nordwestliche Zone-Sommerzeit", "HEEG": "Ostgrönland-Sommerzeit", "HNPMX": "Mexiko Pazifikzone-Normalzeit", "HEPM": "Saint-Pierre-und-Miquelon-Sommerzeit", "UYT": "Uruguyanische Normalzeit", "HKT": "Hongkong-Normalzeit", "HKST": "Hongkong-Sommerzeit", "BOT": "Bolivianische Zeit", "CST": "Nordamerikanische Inland-Normalzeit", "ACWDT": "Zentral-/Westaustralische Sommerzeit", "ADT": "Atlantik-Sommerzeit", "ARST": "Argentinische Sommerzeit", "GMT": "Mittlere Greenwich-Zeit", "HNPM": "Saint-Pierre-und-Miquelon-Normalzeit", "CHADT": "Chatham-Sommerzeit", "NZDT": "Neuseeland-Sommerzeit", "EDT": "Nordamerikanische Ostküsten-Sommerzeit", "HECU": "Kubanische Sommerzeit", "OESZ": "Osteuropäische Sommerzeit", "IST": "Indische Zeit", "AKDT": "Alaska-Sommerzeit", "WIB": "Westindonesische Zeit", "ChST": "Chamorro-Zeit", "PDT": "Nordamerikanische Westküsten-Sommerzeit", "HNCU": "Kubanische Normalzeit", "AWST": "Westaustralische Normalzeit", "UYST": "Uruguayanische Sommerzeit", "TMST": "Turkmenistan-Sommerzeit", "EAT": "Ostafrikanische Zeit", "HEPMX": "Mexiko Pazifikzone-Sommerzeit", "WART": "Westargentinische Normalzeit", "WAT": "Westafrikanische Normalzeit", "CLT": "Chilenische Normalzeit", "WIT": "Ostindonesische Zeit", "MEZ": "Mitteleuropäische Normalzeit", "HAST": "Hawaii-Aleuten-Normalzeit", "HNNOMX": "Mexiko Nordwestliche Zone-Normalzeit", "AKST": "Alaska-Normalzeit", "CHAST": "Chatham-Normalzeit", "ACWST": "Zentral-/Westaustralische Normalzeit", "OEZ": "Osteuropäische Normalzeit", "SAST": "Südafrikanische Zeit", "WAST": "Westafrikanische Sommerzeit", "HNT": "Neufundland-Normalzeit", "CLST": "Chilenische Sommerzeit", "SGT": "Singapur-Zeit", "PST": "Nordamerikanische Westküsten-Normalzeit", "MDT": "Macau-Sommerzeit", "TMT": "Turkmenistan-Normalzeit", "HADT": "Hawaii-Aleuten-Sommerzeit", "WITA": "Zentralindonesische Zeit", "JDT": "Japanische Sommerzeit", "HNEG": "Ostgrönland-Normalzeit", "GFT": "Französisch-Guayana-Zeit", "∅∅∅": "Amazonas-Sommerzeit", "ECT": "Ecuadorianische Zeit", "MST": "Macau-Normalzeit", "GYT": "Guyana-Zeit", "ACDT": "Zentralaustralische Sommerzeit", "BT": "Bhutan-Zeit"},
80 // Locale returns the current translators string locale
81 func (de *de_AT) Locale() string {
85 // PluralsCardinal returns the list of cardinal plural rules associated with 'de_AT'
86 func (de *de_AT) PluralsCardinal() []locales.PluralRule {
87 return de.pluralsCardinal
90 // PluralsOrdinal returns the list of ordinal plural rules associated with 'de_AT'
91 func (de *de_AT) PluralsOrdinal() []locales.PluralRule {
92 return de.pluralsOrdinal
95 // PluralsRange returns the list of range plural rules associated with 'de_AT'
96 func (de *de_AT) PluralsRange() []locales.PluralRule {
97 return de.pluralsRange
100 // CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'de_AT'
101 func (de *de_AT) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
106 if i == 1 && v == 0 {
107 return locales.PluralRuleOne
110 return locales.PluralRuleOther
113 // OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'de_AT'
114 func (de *de_AT) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
115 return locales.PluralRuleOther
118 // RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'de_AT'
119 func (de *de_AT) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
121 start := de.CardinalPluralRule(num1, v1)
122 end := de.CardinalPluralRule(num2, v2)
124 if start == locales.PluralRuleOne && end == locales.PluralRuleOther {
125 return locales.PluralRuleOther
126 } else if start == locales.PluralRuleOther && end == locales.PluralRuleOne {
127 return locales.PluralRuleOne
130 return locales.PluralRuleOther
134 // MonthAbbreviated returns the locales abbreviated month given the 'month' provided
135 func (de *de_AT) MonthAbbreviated(month time.Month) string {
136 return de.monthsAbbreviated[month]
139 // MonthsAbbreviated returns the locales abbreviated months
140 func (de *de_AT) MonthsAbbreviated() []string {
141 return de.monthsAbbreviated[1:]
144 // MonthNarrow returns the locales narrow month given the 'month' provided
145 func (de *de_AT) MonthNarrow(month time.Month) string {
146 return de.monthsNarrow[month]
149 // MonthsNarrow returns the locales narrow months
150 func (de *de_AT) MonthsNarrow() []string {
151 return de.monthsNarrow[1:]
154 // MonthWide returns the locales wide month given the 'month' provided
155 func (de *de_AT) MonthWide(month time.Month) string {
156 return de.monthsWide[month]
159 // MonthsWide returns the locales wide months
160 func (de *de_AT) MonthsWide() []string {
161 return de.monthsWide[1:]
164 // WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
165 func (de *de_AT) WeekdayAbbreviated(weekday time.Weekday) string {
166 return de.daysAbbreviated[weekday]
169 // WeekdaysAbbreviated returns the locales abbreviated weekdays
170 func (de *de_AT) WeekdaysAbbreviated() []string {
171 return de.daysAbbreviated
174 // WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
175 func (de *de_AT) WeekdayNarrow(weekday time.Weekday) string {
176 return de.daysNarrow[weekday]
179 // WeekdaysNarrow returns the locales narrow weekdays
180 func (de *de_AT) WeekdaysNarrow() []string {
184 // WeekdayShort returns the locales short weekday given the 'weekday' provided
185 func (de *de_AT) WeekdayShort(weekday time.Weekday) string {
186 return de.daysShort[weekday]
189 // WeekdaysShort returns the locales short weekdays
190 func (de *de_AT) WeekdaysShort() []string {
194 // WeekdayWide returns the locales wide weekday given the 'weekday' provided
195 func (de *de_AT) WeekdayWide(weekday time.Weekday) string {
196 return de.daysWide[weekday]
199 // WeekdaysWide returns the locales wide weekdays
200 func (de *de_AT) WeekdaysWide() []string {
204 // Decimal returns the decimal point of number
205 func (de *de_AT) Decimal() string {
209 // Group returns the group of number
210 func (de *de_AT) Group() string {
214 // Group returns the minus sign of number
215 func (de *de_AT) Minus() string {
219 // FmtNumber returns 'num' with digits/precision of 'v' for 'de_AT' and handles both Whole and Real numbers based on 'v'
220 func (de *de_AT) FmtNumber(num float64, v uint64) string {
222 s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
223 l := len(s) + 2 + 2*len(s[:len(s)-int(v)-1])/3
226 b := make([]byte, 0, l)
228 for i := len(s) - 1; i >= 0; i-- {
231 b = append(b, de.decimal[0])
238 for j := len(de.group) - 1; j >= 0; j-- {
239 b = append(b, de.group[j])
251 b = append(b, de.minus[0])
255 for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
256 b[i], b[j] = b[j], b[i]
262 // FmtPercent returns 'num' with digits/precision of 'v' for 'de_AT' and handles both Whole and Real numbers based on 'v'
263 // NOTE: 'num' passed into FmtPercent is assumed to be in percent already
264 func (de *de_AT) FmtPercent(num float64, v uint64) string {
265 s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
267 b := make([]byte, 0, l)
269 for i := len(s) - 1; i >= 0; i-- {
272 b = append(b, de.decimal[0])
280 b = append(b, de.minus[0])
284 for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
285 b[i], b[j] = b[j], b[i]
288 b = append(b, de.percentSuffix...)
290 b = append(b, de.percent...)
295 // FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'de_AT'
296 func (de *de_AT) FmtCurrency(num float64, v uint64, currency currency.Type) string {
298 s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
299 symbol := de.currencies[currency]
300 l := len(s) + len(symbol) + 4 + 2*len(s[:len(s)-int(v)-1])/3
303 b := make([]byte, 0, l)
305 for i := len(s) - 1; i >= 0; i-- {
308 b = append(b, de.decimal[0])
315 for j := len(de.group) - 1; j >= 0; j-- {
316 b = append(b, de.group[j])
327 for j := len(symbol) - 1; j >= 0; j-- {
328 b = append(b, symbol[j])
331 for j := len(de.currencyPositivePrefix) - 1; j >= 0; j-- {
332 b = append(b, de.currencyPositivePrefix[j])
336 b = append(b, de.minus[0])
340 for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
341 b[i], b[j] = b[j], b[i]
347 b = append(b, de.decimal...)
350 for i := 0; i < 2-int(v); i++ {
358 // FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'de_AT'
359 // in accounting notation.
360 func (de *de_AT) FmtAccounting(num float64, v uint64, currency currency.Type) string {
362 s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
363 symbol := de.currencies[currency]
364 l := len(s) + len(symbol) + 4 + 2*len(s[:len(s)-int(v)-1])/3
367 b := make([]byte, 0, l)
369 for i := len(s) - 1; i >= 0; i-- {
372 b = append(b, de.decimal[0])
379 for j := len(de.group) - 1; j >= 0; j-- {
380 b = append(b, de.group[j])
393 for j := len(symbol) - 1; j >= 0; j-- {
394 b = append(b, symbol[j])
397 for j := len(de.currencyNegativePrefix) - 1; j >= 0; j-- {
398 b = append(b, de.currencyNegativePrefix[j])
401 b = append(b, de.minus[0])
405 for j := len(symbol) - 1; j >= 0; j-- {
406 b = append(b, symbol[j])
409 for j := len(de.currencyPositivePrefix) - 1; j >= 0; j-- {
410 b = append(b, de.currencyPositivePrefix[j])
416 for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
417 b[i], b[j] = b[j], b[i]
423 b = append(b, de.decimal...)
426 for i := 0; i < 2-int(v); i++ {
434 // FmtDateShort returns the short date representation of 't' for 'de_AT'
435 func (de *de_AT) FmtDateShort(t time.Time) string {
437 b := make([]byte, 0, 32)
443 b = strconv.AppendInt(b, int64(t.Day()), 10)
444 b = append(b, []byte{0x2e}...)
450 b = strconv.AppendInt(b, int64(t.Month()), 10)
452 b = append(b, []byte{0x2e}...)
455 b = append(b, strconv.Itoa(t.Year())[2:]...)
457 b = append(b, strconv.Itoa(t.Year())[1:]...)
463 // FmtDateMedium returns the medium date representation of 't' for 'de_AT'
464 func (de *de_AT) FmtDateMedium(t time.Time) string {
466 b := make([]byte, 0, 32)
472 b = strconv.AppendInt(b, int64(t.Day()), 10)
473 b = append(b, []byte{0x2e}...)
479 b = strconv.AppendInt(b, int64(t.Month()), 10)
481 b = append(b, []byte{0x2e}...)
484 b = strconv.AppendInt(b, int64(t.Year()), 10)
486 b = strconv.AppendInt(b, int64(-t.Year()), 10)
492 // FmtDateLong returns the long date representation of 't' for 'de_AT'
493 func (de *de_AT) FmtDateLong(t time.Time) string {
495 b := make([]byte, 0, 32)
497 b = strconv.AppendInt(b, int64(t.Day()), 10)
498 b = append(b, []byte{0x2e, 0x20}...)
499 b = append(b, de.monthsWide[t.Month()]...)
500 b = append(b, []byte{0x20}...)
503 b = strconv.AppendInt(b, int64(t.Year()), 10)
505 b = strconv.AppendInt(b, int64(-t.Year()), 10)
511 // FmtDateFull returns the full date representation of 't' for 'de_AT'
512 func (de *de_AT) FmtDateFull(t time.Time) string {
514 b := make([]byte, 0, 32)
516 b = append(b, de.daysWide[t.Weekday()]...)
517 b = append(b, []byte{0x2c, 0x20}...)
518 b = strconv.AppendInt(b, int64(t.Day()), 10)
519 b = append(b, []byte{0x2e, 0x20}...)
520 b = append(b, de.monthsWide[t.Month()]...)
521 b = append(b, []byte{0x20}...)
524 b = strconv.AppendInt(b, int64(t.Year()), 10)
526 b = strconv.AppendInt(b, int64(-t.Year()), 10)
532 // FmtTimeShort returns the short time representation of 't' for 'de_AT'
533 func (de *de_AT) FmtTimeShort(t time.Time) string {
535 b := make([]byte, 0, 32)
541 b = strconv.AppendInt(b, int64(t.Hour()), 10)
542 b = append(b, de.timeSeparator...)
548 b = strconv.AppendInt(b, int64(t.Minute()), 10)
553 // FmtTimeMedium returns the medium time representation of 't' for 'de_AT'
554 func (de *de_AT) FmtTimeMedium(t time.Time) string {
556 b := make([]byte, 0, 32)
562 b = strconv.AppendInt(b, int64(t.Hour()), 10)
563 b = append(b, de.timeSeparator...)
569 b = strconv.AppendInt(b, int64(t.Minute()), 10)
570 b = append(b, de.timeSeparator...)
576 b = strconv.AppendInt(b, int64(t.Second()), 10)
581 // FmtTimeLong returns the long time representation of 't' for 'de_AT'
582 func (de *de_AT) FmtTimeLong(t time.Time) string {
584 b := make([]byte, 0, 32)
590 b = strconv.AppendInt(b, int64(t.Hour()), 10)
591 b = append(b, de.timeSeparator...)
597 b = strconv.AppendInt(b, int64(t.Minute()), 10)
598 b = append(b, de.timeSeparator...)
604 b = strconv.AppendInt(b, int64(t.Second()), 10)
605 b = append(b, []byte{0x20}...)
613 // FmtTimeFull returns the full time representation of 't' for 'de_AT'
614 func (de *de_AT) FmtTimeFull(t time.Time) string {
616 b := make([]byte, 0, 32)
622 b = strconv.AppendInt(b, int64(t.Hour()), 10)
623 b = append(b, de.timeSeparator...)
629 b = strconv.AppendInt(b, int64(t.Minute()), 10)
630 b = append(b, de.timeSeparator...)
636 b = strconv.AppendInt(b, int64(t.Second()), 10)
637 b = append(b, []byte{0x20}...)
641 if btz, ok := de.timezones[tz]; ok {
642 b = append(b, btz...)