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 'lb_LU' locale
46 func New() locales.Translator {
49 pluralsCardinal: []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 currencyPositiveSuffix: " ",
62 currencyNegativeSuffix: " ",
63 monthsAbbreviated: []string{"", "Jan.", "Feb.", "Mäe.", "Abr.", "Mee", "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{"", "Januar", "Februar", "Mäerz", "Abrëll", "Mee", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember"},
66 daysAbbreviated: []string{"Son.", "Méi.", "Dën.", "Mët.", "Don.", "Fre.", "Sam."},
67 daysNarrow: []string{"S", "M", "D", "M", "D", "F", "S"},
68 daysShort: []string{"So.", "Mé.", "Dë.", "Më.", "Do.", "Fr.", "Sa."},
69 daysWide: []string{"Sonndeg", "Méindeg", "Dënschdeg", "Mëttwoch", "Donneschdeg", "Freideg", "Samschdeg"},
70 periodsAbbreviated: []string{"moies", "nomëttes"},
71 periodsNarrow: []string{"mo.", "nomë."},
72 periodsWide: []string{"moies", "nomëttes"},
73 erasAbbreviated: []string{"v. Chr.", "n. Chr."},
74 erasNarrow: []string{"", ""},
75 erasWide: []string{"v. Chr.", "n. Chr."},
76 timezones: map[string]string{"JDT": "Japanesch Summerzäit", "∅∅∅": "Brasília-Summerzäit", "CDT": "Nordamerikanesch Inland-Summerzäit", "SRT": "Suriname-Zäit", "ACWDT": "Zentral-/Westaustralesch Summerzäit", "NZST": "Neiséiland-Normalzäit", "PST": "Nordamerikanesch Westküsten-Normalzäit", "BOT": "Bolivianesch Zäit", "COST": "Kolumbianesch Summerzäit", "AKST": "Alaska-Normalzäit", "ChST": "Chamorro-Zäit", "ECT": "Ecuadorianesch Zäit", "HNPMX": "Mexikanesch Pazifik-Normalzäit", "VET": "Venezuela-Zäit", "HENOMX": "Nordwest-Mexiko-Summerzäit", "ARST": "Argentinesch Summerzäit", "PDT": "Nordamerikanesch Westküsten-Summerzäit", "UYST": "Uruguayanesch Summerzäit", "MESZ": "Mëtteleuropäesch Summerzäit", "OEZ": "Osteuropäesch Normalzäit", "LHST": "Lord-Howe-Normalzäit", "SAST": "Südafrikanesch Zäit", "CLT": "Chilenesch Normalzäit", "ACDT": "Zentralaustralesch Summerzäit", "SGT": "Singapur-Standardzäit", "WIT": "Ostindonesesch Zäit", "OESZ": "Osteuropäesch Summerzäit", "GYT": "Guyana-Zäit", "WIB": "Westindonesesch Zäit", "HECU": "Kubanesch Summerzäit", "WITA": "Zentralindonesesch Zäit", "HNOG": "Westgrönland-Normalzäit", "HEEG": "Ostgrönland-Summerzäit", "HAT": "Neifundland-Summerzäit", "ACWST": "Zentral-/Westaustralesch Normalzäit", "TMT": "Turkmenistan-Normalzäit", "TMST": "Turkmenistan-Summerzäit", "JST": "Japanesch Normalzäit", "HKT": "Hong-Kong-Normalzäit", "EAT": "Ostafrikanesch Zäit", "HNPM": "Saint-Pierre-a-Miquelon-Normalzäit", "CST": "Nordamerikanesch Inland-Normalzäit", "MST": "MST", "LHDT": "Lord-Howe-Summerzäit", "AEDT": "Ostaustralesch Summerzäit", "HNCU": "Kubanesch Normalzäit", "AWST": "Westaustralesch Normalzäit", "MEZ": "Mëtteleuropäesch Normalzäit", "HEOG": "Westgrönland-Summerzäit", "UYT": "Uruguyanesch Normalzäit", "HADT": "Hawaii-Aleuten-Summerzäit", "WARST": "Westargentinesch Summerzäit", "WAT": "Westafrikanesch Normalzäit", "CAT": "Zentralafrikanesch Zäit", "EST": "Nordamerikanesch Ostküsten-Normalzäit", "ACST": "Zentralaustralesch Normalzäit", "WEZ": "Westeuropäesch Normalzäit", "GMT": "Mëttler Greenwich-Zäit", "CHAST": "Chatham-Normalzäit", "HEPM": "Saint-Pierre-a-Miquelon-Summerzäit", "MYT": "Malaysesch Zäit", "HNT": "Neifundland-Normalzäit", "HKST": "Hong-Kong-Summerzäit", "AEST": "Ostaustralesch Normalzäit", "CLST": "Chilenesch Summerzäit", "GFT": "Franséisch-Guayane-Zäit", "ADT": "Atlantik-Summerzäit", "EDT": "Nordamerikanesch Ostküsten-Summerzäit", "HEPMX": "Mexikanesch Pazifik-Summerzäit", "BT": "Bhutan-Zäit", "MDT": "MDT", "HAST": "Hawaii-Aleuten-Normalzäit", "IST": "Indesch Zäit", "AST": "Atlantik-Normalzäit", "AWDT": "Westaustralesch Summerzäit", "WART": "Westargentinesch Normalzäit", "HNEG": "Ostgrönland-Normalzäit", "COT": "Kolumbianesch Normalzäit", "AKDT": "Alaska-Summerzäit", "WESZ": "Westeuropäesch Summerzäit", "CHADT": "Chatham-Summerzäit", "NZDT": "Neiséiland-Summerzäit", "HNNOMX": "Nordwest-Mexiko-Normalzäit", "ART": "Argentinesch Normalzäit", "WAST": "Westafrikanesch Summerzäit"},
80 // Locale returns the current translators string locale
81 func (lb *lb_LU) Locale() string {
85 // PluralsCardinal returns the list of cardinal plural rules associated with 'lb_LU'
86 func (lb *lb_LU) PluralsCardinal() []locales.PluralRule {
87 return lb.pluralsCardinal
90 // PluralsOrdinal returns the list of ordinal plural rules associated with 'lb_LU'
91 func (lb *lb_LU) PluralsOrdinal() []locales.PluralRule {
92 return lb.pluralsOrdinal
95 // PluralsRange returns the list of range plural rules associated with 'lb_LU'
96 func (lb *lb_LU) PluralsRange() []locales.PluralRule {
97 return lb.pluralsRange
100 // CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'lb_LU'
101 func (lb *lb_LU) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
106 return locales.PluralRuleOne
109 return locales.PluralRuleOther
112 // OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'lb_LU'
113 func (lb *lb_LU) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
114 return locales.PluralRuleUnknown
117 // RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'lb_LU'
118 func (lb *lb_LU) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
119 return locales.PluralRuleUnknown
122 // MonthAbbreviated returns the locales abbreviated month given the 'month' provided
123 func (lb *lb_LU) MonthAbbreviated(month time.Month) string {
124 return lb.monthsAbbreviated[month]
127 // MonthsAbbreviated returns the locales abbreviated months
128 func (lb *lb_LU) MonthsAbbreviated() []string {
129 return lb.monthsAbbreviated[1:]
132 // MonthNarrow returns the locales narrow month given the 'month' provided
133 func (lb *lb_LU) MonthNarrow(month time.Month) string {
134 return lb.monthsNarrow[month]
137 // MonthsNarrow returns the locales narrow months
138 func (lb *lb_LU) MonthsNarrow() []string {
139 return lb.monthsNarrow[1:]
142 // MonthWide returns the locales wide month given the 'month' provided
143 func (lb *lb_LU) MonthWide(month time.Month) string {
144 return lb.monthsWide[month]
147 // MonthsWide returns the locales wide months
148 func (lb *lb_LU) MonthsWide() []string {
149 return lb.monthsWide[1:]
152 // WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
153 func (lb *lb_LU) WeekdayAbbreviated(weekday time.Weekday) string {
154 return lb.daysAbbreviated[weekday]
157 // WeekdaysAbbreviated returns the locales abbreviated weekdays
158 func (lb *lb_LU) WeekdaysAbbreviated() []string {
159 return lb.daysAbbreviated
162 // WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
163 func (lb *lb_LU) WeekdayNarrow(weekday time.Weekday) string {
164 return lb.daysNarrow[weekday]
167 // WeekdaysNarrow returns the locales narrow weekdays
168 func (lb *lb_LU) WeekdaysNarrow() []string {
172 // WeekdayShort returns the locales short weekday given the 'weekday' provided
173 func (lb *lb_LU) WeekdayShort(weekday time.Weekday) string {
174 return lb.daysShort[weekday]
177 // WeekdaysShort returns the locales short weekdays
178 func (lb *lb_LU) WeekdaysShort() []string {
182 // WeekdayWide returns the locales wide weekday given the 'weekday' provided
183 func (lb *lb_LU) WeekdayWide(weekday time.Weekday) string {
184 return lb.daysWide[weekday]
187 // WeekdaysWide returns the locales wide weekdays
188 func (lb *lb_LU) WeekdaysWide() []string {
192 // Decimal returns the decimal point of number
193 func (lb *lb_LU) Decimal() string {
197 // Group returns the group of number
198 func (lb *lb_LU) Group() string {
202 // Group returns the minus sign of number
203 func (lb *lb_LU) Minus() string {
207 // FmtNumber returns 'num' with digits/precision of 'v' for 'lb_LU' and handles both Whole and Real numbers based on 'v'
208 func (lb *lb_LU) FmtNumber(num float64, v uint64) string {
210 s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
211 l := len(s) + 2 + 1*len(s[:len(s)-int(v)-1])/3
214 b := make([]byte, 0, l)
216 for i := len(s) - 1; i >= 0; i-- {
219 b = append(b, lb.decimal[0])
226 b = append(b, lb.group[0])
237 b = append(b, lb.minus[0])
241 for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
242 b[i], b[j] = b[j], b[i]
248 // FmtPercent returns 'num' with digits/precision of 'v' for 'lb_LU' and handles both Whole and Real numbers based on 'v'
249 // NOTE: 'num' passed into FmtPercent is assumed to be in percent already
250 func (lb *lb_LU) FmtPercent(num float64, v uint64) string {
251 s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
253 b := make([]byte, 0, l)
255 for i := len(s) - 1; i >= 0; i-- {
258 b = append(b, lb.decimal[0])
266 b = append(b, lb.minus[0])
270 for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
271 b[i], b[j] = b[j], b[i]
274 b = append(b, lb.percentSuffix...)
276 b = append(b, lb.percent...)
281 // FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'lb_LU'
282 func (lb *lb_LU) FmtCurrency(num float64, v uint64, currency currency.Type) string {
284 s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
285 symbol := lb.currencies[currency]
286 l := len(s) + len(symbol) + 4 + 1*len(s[:len(s)-int(v)-1])/3
289 b := make([]byte, 0, l)
291 for i := len(s) - 1; i >= 0; i-- {
294 b = append(b, lb.decimal[0])
301 b = append(b, lb.group[0])
312 b = append(b, lb.minus[0])
316 for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
317 b[i], b[j] = b[j], b[i]
323 b = append(b, lb.decimal...)
326 for i := 0; i < 2-int(v); i++ {
331 b = append(b, lb.currencyPositiveSuffix...)
333 b = append(b, symbol...)
338 // FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'lb_LU'
339 // in accounting notation.
340 func (lb *lb_LU) FmtAccounting(num float64, v uint64, currency currency.Type) string {
342 s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
343 symbol := lb.currencies[currency]
344 l := len(s) + len(symbol) + 4 + 1*len(s[:len(s)-int(v)-1])/3
347 b := make([]byte, 0, l)
349 for i := len(s) - 1; i >= 0; i-- {
352 b = append(b, lb.decimal[0])
359 b = append(b, lb.group[0])
371 b = append(b, lb.minus[0])
376 for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
377 b[i], b[j] = b[j], b[i]
383 b = append(b, lb.decimal...)
386 for i := 0; i < 2-int(v); i++ {
392 b = append(b, lb.currencyNegativeSuffix...)
393 b = append(b, symbol...)
396 b = append(b, lb.currencyPositiveSuffix...)
397 b = append(b, symbol...)
403 // FmtDateShort returns the short date representation of 't' for 'lb_LU'
404 func (lb *lb_LU) FmtDateShort(t time.Time) string {
406 b := make([]byte, 0, 32)
412 b = strconv.AppendInt(b, int64(t.Day()), 10)
413 b = append(b, []byte{0x2e}...)
419 b = strconv.AppendInt(b, int64(t.Month()), 10)
421 b = append(b, []byte{0x2e}...)
424 b = append(b, strconv.Itoa(t.Year())[2:]...)
426 b = append(b, strconv.Itoa(t.Year())[1:]...)
432 // FmtDateMedium returns the medium date representation of 't' for 'lb_LU'
433 func (lb *lb_LU) FmtDateMedium(t time.Time) string {
435 b := make([]byte, 0, 32)
437 b = strconv.AppendInt(b, int64(t.Day()), 10)
438 b = append(b, []byte{0x2e, 0x20}...)
439 b = append(b, lb.monthsAbbreviated[t.Month()]...)
440 b = append(b, []byte{0x20}...)
443 b = strconv.AppendInt(b, int64(t.Year()), 10)
445 b = strconv.AppendInt(b, int64(-t.Year()), 10)
451 // FmtDateLong returns the long date representation of 't' for 'lb_LU'
452 func (lb *lb_LU) FmtDateLong(t time.Time) string {
454 b := make([]byte, 0, 32)
456 b = strconv.AppendInt(b, int64(t.Day()), 10)
457 b = append(b, []byte{0x2e, 0x20}...)
458 b = append(b, lb.monthsWide[t.Month()]...)
459 b = append(b, []byte{0x20}...)
462 b = strconv.AppendInt(b, int64(t.Year()), 10)
464 b = strconv.AppendInt(b, int64(-t.Year()), 10)
470 // FmtDateFull returns the full date representation of 't' for 'lb_LU'
471 func (lb *lb_LU) FmtDateFull(t time.Time) string {
473 b := make([]byte, 0, 32)
475 b = append(b, lb.daysWide[t.Weekday()]...)
476 b = append(b, []byte{0x2c, 0x20}...)
477 b = strconv.AppendInt(b, int64(t.Day()), 10)
478 b = append(b, []byte{0x2e, 0x20}...)
479 b = append(b, lb.monthsWide[t.Month()]...)
480 b = append(b, []byte{0x20}...)
483 b = strconv.AppendInt(b, int64(t.Year()), 10)
485 b = strconv.AppendInt(b, int64(-t.Year()), 10)
491 // FmtTimeShort returns the short time representation of 't' for 'lb_LU'
492 func (lb *lb_LU) FmtTimeShort(t time.Time) string {
494 b := make([]byte, 0, 32)
500 b = strconv.AppendInt(b, int64(t.Hour()), 10)
501 b = append(b, lb.timeSeparator...)
507 b = strconv.AppendInt(b, int64(t.Minute()), 10)
512 // FmtTimeMedium returns the medium time representation of 't' for 'lb_LU'
513 func (lb *lb_LU) FmtTimeMedium(t time.Time) string {
515 b := make([]byte, 0, 32)
521 b = strconv.AppendInt(b, int64(t.Hour()), 10)
522 b = append(b, lb.timeSeparator...)
528 b = strconv.AppendInt(b, int64(t.Minute()), 10)
529 b = append(b, lb.timeSeparator...)
535 b = strconv.AppendInt(b, int64(t.Second()), 10)
540 // FmtTimeLong returns the long time representation of 't' for 'lb_LU'
541 func (lb *lb_LU) FmtTimeLong(t time.Time) string {
543 b := make([]byte, 0, 32)
549 b = strconv.AppendInt(b, int64(t.Hour()), 10)
550 b = append(b, lb.timeSeparator...)
556 b = strconv.AppendInt(b, int64(t.Minute()), 10)
557 b = append(b, lb.timeSeparator...)
563 b = strconv.AppendInt(b, int64(t.Second()), 10)
564 b = append(b, []byte{0x20}...)
572 // FmtTimeFull returns the full time representation of 't' for 'lb_LU'
573 func (lb *lb_LU) FmtTimeFull(t time.Time) string {
575 b := make([]byte, 0, 32)
581 b = strconv.AppendInt(b, int64(t.Hour()), 10)
582 b = append(b, lb.timeSeparator...)
588 b = strconv.AppendInt(b, int64(t.Minute()), 10)
589 b = append(b, lb.timeSeparator...)
595 b = strconv.AppendInt(b, int64(t.Second()), 10)
596 b = append(b, []byte{0x20}...)
600 if btz, ok := lb.timezones[tz]; ok {
601 b = append(b, btz...)