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 currencyNegativePrefix string
28 currencyNegativeSuffix string
29 monthsAbbreviated []string
32 daysAbbreviated []string
36 periodsAbbreviated []string
37 periodsNarrow []string
40 erasAbbreviated []string
43 timezones map[string]string
46 // New returns a new instance of translator for the 'sk_SK' locale
47 func New() locales.Translator {
50 pluralsCardinal: []locales.PluralRule{2, 4, 5, 6},
51 pluralsOrdinal: []locales.PluralRule{6},
52 pluralsRange: []locales.PluralRule{2, 4, 5, 6},
60 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"},
62 currencyPositiveSuffix: " ",
63 currencyNegativePrefix: "(",
64 currencyNegativeSuffix: " )",
65 monthsAbbreviated: []string{"", "jan", "feb", "mar", "apr", "máj", "jún", "júl", "aug", "sep", "okt", "nov", "dec"},
66 monthsNarrow: []string{"", "j", "f", "m", "a", "m", "j", "j", "a", "s", "o", "n", "d"},
67 monthsWide: []string{"", "januára", "februára", "marca", "apríla", "mája", "júna", "júla", "augusta", "septembra", "októbra", "novembra", "decembra"},
68 daysAbbreviated: []string{"ne", "po", "ut", "st", "št", "pi", "so"},
69 daysNarrow: []string{"n", "p", "u", "s", "š", "p", "s"},
70 daysShort: []string{"ne", "po", "ut", "st", "št", "pi", "so"},
71 daysWide: []string{"nedeľa", "pondelok", "utorok", "streda", "štvrtok", "piatok", "sobota"},
72 periodsAbbreviated: []string{"AM", "PM"},
73 periodsNarrow: []string{"AM", "PM"},
74 periodsWide: []string{"AM", "PM"},
75 erasAbbreviated: []string{"pred Kr.", "po Kr."},
76 erasNarrow: []string{"", ""},
77 erasWide: []string{"pred Kristom", "po Kristovi"},
78 timezones: map[string]string{"ACST": "stredoaustrálsky štandardný čas", "GYT": "guyanský čas", "EST": "severoamerický východný štandardný čas", "AKDT": "aljašský letný čas", "WESZ": "západoeurópsky letný čas", "PDT": "severoamerický tichomorský letný čas", "CHAST": "chathamský štandardný čas", "HNCU": "kubánsky štandardný čas", "BT": "bhutánsky čas", "HAT": "newfoundlandský letný čas", "ACWDT": "stredozápadný austrálsky letný čas", "AWST": "západoaustrálsky štandardný čas", "AEST": "východoaustrálsky štandardný čas", "HEEG": "východogrónsky letný čas", "GMT": "greenwichský čas", "HEPMX": "mexický tichomorský letný čas", "HNNOMX": "severozápadný mexický štandardný čas", "IST": "indický čas", "WIB": "západoindonézsky čas", "AWDT": "západoaustrálsky letný čas", "HAST": "havajsko-aleutský štandardný čas", "TMST": "turkménsky letný čas", "HENOMX": "severozápadný mexický letný čas", "LHDT": "letný čas ostrova lorda Howa", "MST": "severoamerický horský štandardný čas", "CLST": "čilský letný čas", "ACDT": "stredoaustrálsky letný čas", "ECT": "ekvádorský čas", "ChST": "chamorrský štandardný čas", "CHADT": "chathamský letný čas", "OEZ": "východoeurópsky štandardný čas", "CDT": "severoamerický centrálny letný čas", "HNEG": "východogrónsky štandardný čas", "CLT": "čilský štandardný čas", "COST": "kolumbijský letný čas", "CST": "severoamerický centrálny štandardný čas", "NZST": "novozélandský štandardný čas", "MDT": "severoamerický horský letný čas", "HKST": "hongkonský letný čas", "UYST": "uruguajský letný čas", "NZDT": "novozélandský letný čas", "LHST": "štandardný čas ostrova lorda Howa", "WIT": "východoindonézsky čas", "EDT": "severoamerický východný letný čas", "SAST": "juhoafrický čas", "SRT": "surinamský čas", "UYT": "uruguajský štandardný čas", "WARST": "západoargentínsky letný čas", "JDT": "japonský letný čas", "AEDT": "východoaustrálsky letný čas", "HNT": "newfoundlandský štandardný čas", "COT": "kolumbijský štandardný čas", "ACWST": "stredozápadný austrálsky štandardný čas", "JST": "japonský štandardný čas", "AST": "atlantický štandardný čas", "ADT": "atlantický letný čas", "HECU": "kubánsky letný čas", "BOT": "bolívijský čas", "MESZ": "stredoeurópsky letný čas", "VET": "venezuelský čas", "WART": "západoargentínsky štandardný čas", "ARST": "argentínsky letný čas", "MYT": "malajzijský čas", "WITA": "stredoindonézsky čas", "AKST": "aljašský štandardný čas", "WEZ": "západoeurópsky štandardný čas", "HEPM": "pierre-miquelonský letný čas", "∅∅∅": "azorský letný čas", "EAT": "východoafrický čas", "HKT": "hongkonský štandardný čas", "TMT": "turkménsky štandardný čas", "ART": "argentínsky štandardný čas", "WAT": "západoafrický štandardný čas", "GFT": "francúzskoguyanský čas", "CAT": "stredoafrický čas", "PST": "severoamerický tichomorský štandardný čas", "HNPM": "pierre-miquelonský štandardný čas", "MEZ": "stredoeurópsky štandardný čas", "HADT": "havajsko-aleutský letný čas", "HNOG": "západogrónsky štandardný čas", "HEOG": "západogrónsky letný čas", "WAST": "západoafrický letný čas", "SGT": "singapurský štandardný čas", "HNPMX": "mexický tichomorský štandardný čas", "OESZ": "východoeurópsky letný čas"},
82 // Locale returns the current translators string locale
83 func (sk *sk_SK) Locale() string {
87 // PluralsCardinal returns the list of cardinal plural rules associated with 'sk_SK'
88 func (sk *sk_SK) PluralsCardinal() []locales.PluralRule {
89 return sk.pluralsCardinal
92 // PluralsOrdinal returns the list of ordinal plural rules associated with 'sk_SK'
93 func (sk *sk_SK) PluralsOrdinal() []locales.PluralRule {
94 return sk.pluralsOrdinal
97 // PluralsRange returns the list of range plural rules associated with 'sk_SK'
98 func (sk *sk_SK) PluralsRange() []locales.PluralRule {
99 return sk.pluralsRange
102 // CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'sk_SK'
103 func (sk *sk_SK) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
108 if i == 1 && v == 0 {
109 return locales.PluralRuleOne
110 } else if i >= 2 && i <= 4 && v == 0 {
111 return locales.PluralRuleFew
113 return locales.PluralRuleMany
116 return locales.PluralRuleOther
119 // OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'sk_SK'
120 func (sk *sk_SK) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
121 return locales.PluralRuleOther
124 // RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'sk_SK'
125 func (sk *sk_SK) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
127 start := sk.CardinalPluralRule(num1, v1)
128 end := sk.CardinalPluralRule(num2, v2)
130 if start == locales.PluralRuleOne && end == locales.PluralRuleFew {
131 return locales.PluralRuleFew
132 } else if start == locales.PluralRuleOne && end == locales.PluralRuleMany {
133 return locales.PluralRuleMany
134 } else if start == locales.PluralRuleOne && end == locales.PluralRuleOther {
135 return locales.PluralRuleOther
136 } else if start == locales.PluralRuleFew && end == locales.PluralRuleFew {
137 return locales.PluralRuleFew
138 } else if start == locales.PluralRuleFew && end == locales.PluralRuleMany {
139 return locales.PluralRuleMany
140 } else if start == locales.PluralRuleFew && end == locales.PluralRuleOther {
141 return locales.PluralRuleOther
142 } else if start == locales.PluralRuleMany && end == locales.PluralRuleOne {
143 return locales.PluralRuleOne
144 } else if start == locales.PluralRuleMany && end == locales.PluralRuleFew {
145 return locales.PluralRuleFew
146 } else if start == locales.PluralRuleMany && end == locales.PluralRuleMany {
147 return locales.PluralRuleMany
148 } else if start == locales.PluralRuleMany && end == locales.PluralRuleOther {
149 return locales.PluralRuleOther
150 } else if start == locales.PluralRuleOther && end == locales.PluralRuleOne {
151 return locales.PluralRuleOne
152 } else if start == locales.PluralRuleOther && end == locales.PluralRuleFew {
153 return locales.PluralRuleFew
154 } else if start == locales.PluralRuleOther && end == locales.PluralRuleMany {
155 return locales.PluralRuleMany
158 return locales.PluralRuleOther
162 // MonthAbbreviated returns the locales abbreviated month given the 'month' provided
163 func (sk *sk_SK) MonthAbbreviated(month time.Month) string {
164 return sk.monthsAbbreviated[month]
167 // MonthsAbbreviated returns the locales abbreviated months
168 func (sk *sk_SK) MonthsAbbreviated() []string {
169 return sk.monthsAbbreviated[1:]
172 // MonthNarrow returns the locales narrow month given the 'month' provided
173 func (sk *sk_SK) MonthNarrow(month time.Month) string {
174 return sk.monthsNarrow[month]
177 // MonthsNarrow returns the locales narrow months
178 func (sk *sk_SK) MonthsNarrow() []string {
179 return sk.monthsNarrow[1:]
182 // MonthWide returns the locales wide month given the 'month' provided
183 func (sk *sk_SK) MonthWide(month time.Month) string {
184 return sk.monthsWide[month]
187 // MonthsWide returns the locales wide months
188 func (sk *sk_SK) MonthsWide() []string {
189 return sk.monthsWide[1:]
192 // WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
193 func (sk *sk_SK) WeekdayAbbreviated(weekday time.Weekday) string {
194 return sk.daysAbbreviated[weekday]
197 // WeekdaysAbbreviated returns the locales abbreviated weekdays
198 func (sk *sk_SK) WeekdaysAbbreviated() []string {
199 return sk.daysAbbreviated
202 // WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
203 func (sk *sk_SK) WeekdayNarrow(weekday time.Weekday) string {
204 return sk.daysNarrow[weekday]
207 // WeekdaysNarrow returns the locales narrow weekdays
208 func (sk *sk_SK) WeekdaysNarrow() []string {
212 // WeekdayShort returns the locales short weekday given the 'weekday' provided
213 func (sk *sk_SK) WeekdayShort(weekday time.Weekday) string {
214 return sk.daysShort[weekday]
217 // WeekdaysShort returns the locales short weekdays
218 func (sk *sk_SK) WeekdaysShort() []string {
222 // WeekdayWide returns the locales wide weekday given the 'weekday' provided
223 func (sk *sk_SK) WeekdayWide(weekday time.Weekday) string {
224 return sk.daysWide[weekday]
227 // WeekdaysWide returns the locales wide weekdays
228 func (sk *sk_SK) WeekdaysWide() []string {
232 // Decimal returns the decimal point of number
233 func (sk *sk_SK) Decimal() string {
237 // Group returns the group of number
238 func (sk *sk_SK) Group() string {
242 // Group returns the minus sign of number
243 func (sk *sk_SK) Minus() string {
247 // FmtNumber returns 'num' with digits/precision of 'v' for 'sk_SK' and handles both Whole and Real numbers based on 'v'
248 func (sk *sk_SK) FmtNumber(num float64, v uint64) string {
250 s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
251 l := len(s) + 2 + 2*len(s[:len(s)-int(v)-1])/3
254 b := make([]byte, 0, l)
256 for i := len(s) - 1; i >= 0; i-- {
259 b = append(b, sk.decimal[0])
266 for j := len(sk.group) - 1; j >= 0; j-- {
267 b = append(b, sk.group[j])
279 b = append(b, sk.minus[0])
283 for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
284 b[i], b[j] = b[j], b[i]
290 // FmtPercent returns 'num' with digits/precision of 'v' for 'sk_SK' and handles both Whole and Real numbers based on 'v'
291 // NOTE: 'num' passed into FmtPercent is assumed to be in percent already
292 func (sk *sk_SK) FmtPercent(num float64, v uint64) string {
293 s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
295 b := make([]byte, 0, l)
297 for i := len(s) - 1; i >= 0; i-- {
300 b = append(b, sk.decimal[0])
308 b = append(b, sk.minus[0])
312 for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
313 b[i], b[j] = b[j], b[i]
316 b = append(b, sk.percentSuffix...)
318 b = append(b, sk.percent...)
323 // FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'sk_SK'
324 func (sk *sk_SK) FmtCurrency(num float64, v uint64, currency currency.Type) string {
326 s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
327 symbol := sk.currencies[currency]
328 l := len(s) + len(symbol) + 4 + 2*len(s[:len(s)-int(v)-1])/3
331 b := make([]byte, 0, l)
333 for i := len(s) - 1; i >= 0; i-- {
336 b = append(b, sk.decimal[0])
343 for j := len(sk.group) - 1; j >= 0; j-- {
344 b = append(b, sk.group[j])
356 b = append(b, sk.minus[0])
360 for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
361 b[i], b[j] = b[j], b[i]
367 b = append(b, sk.decimal...)
370 for i := 0; i < 2-int(v); i++ {
375 b = append(b, sk.currencyPositiveSuffix...)
377 b = append(b, symbol...)
382 // FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'sk_SK'
383 // in accounting notation.
384 func (sk *sk_SK) FmtAccounting(num float64, v uint64, currency currency.Type) string {
386 s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
387 symbol := sk.currencies[currency]
388 l := len(s) + len(symbol) + 6 + 2*len(s[:len(s)-int(v)-1])/3
391 b := make([]byte, 0, l)
393 for i := len(s) - 1; i >= 0; i-- {
396 b = append(b, sk.decimal[0])
403 for j := len(sk.group) - 1; j >= 0; j-- {
404 b = append(b, sk.group[j])
417 b = append(b, sk.currencyNegativePrefix[0])
422 for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
423 b[i], b[j] = b[j], b[i]
429 b = append(b, sk.decimal...)
432 for i := 0; i < 2-int(v); i++ {
438 b = append(b, sk.currencyNegativeSuffix...)
439 b = append(b, symbol...)
442 b = append(b, sk.currencyPositiveSuffix...)
443 b = append(b, symbol...)
449 // FmtDateShort returns the short date representation of 't' for 'sk_SK'
450 func (sk *sk_SK) FmtDateShort(t time.Time) string {
452 b := make([]byte, 0, 32)
454 b = strconv.AppendInt(b, int64(t.Day()), 10)
455 b = append(b, []byte{0x2e, 0x20}...)
456 b = strconv.AppendInt(b, int64(t.Month()), 10)
457 b = append(b, []byte{0x2e, 0x20}...)
460 b = strconv.AppendInt(b, int64(t.Year()), 10)
462 b = strconv.AppendInt(b, int64(-t.Year()), 10)
468 // FmtDateMedium returns the medium date representation of 't' for 'sk_SK'
469 func (sk *sk_SK) FmtDateMedium(t time.Time) string {
471 b := make([]byte, 0, 32)
473 b = strconv.AppendInt(b, int64(t.Day()), 10)
474 b = append(b, []byte{0x2e, 0x20}...)
475 b = strconv.AppendInt(b, int64(t.Month()), 10)
476 b = append(b, []byte{0x2e, 0x20}...)
479 b = strconv.AppendInt(b, int64(t.Year()), 10)
481 b = strconv.AppendInt(b, int64(-t.Year()), 10)
487 // FmtDateLong returns the long date representation of 't' for 'sk_SK'
488 func (sk *sk_SK) FmtDateLong(t time.Time) string {
490 b := make([]byte, 0, 32)
492 b = strconv.AppendInt(b, int64(t.Day()), 10)
493 b = append(b, []byte{0x2e, 0x20}...)
494 b = append(b, sk.monthsWide[t.Month()]...)
495 b = append(b, []byte{0x20}...)
498 b = strconv.AppendInt(b, int64(t.Year()), 10)
500 b = strconv.AppendInt(b, int64(-t.Year()), 10)
506 // FmtDateFull returns the full date representation of 't' for 'sk_SK'
507 func (sk *sk_SK) FmtDateFull(t time.Time) string {
509 b := make([]byte, 0, 32)
511 b = append(b, sk.daysWide[t.Weekday()]...)
512 b = append(b, []byte{0x2c, 0x20}...)
513 b = strconv.AppendInt(b, int64(t.Day()), 10)
514 b = append(b, []byte{0x2e, 0x20}...)
515 b = append(b, sk.monthsWide[t.Month()]...)
516 b = append(b, []byte{0x20}...)
519 b = strconv.AppendInt(b, int64(t.Year()), 10)
521 b = strconv.AppendInt(b, int64(-t.Year()), 10)
527 // FmtTimeShort returns the short time representation of 't' for 'sk_SK'
528 func (sk *sk_SK) FmtTimeShort(t time.Time) string {
530 b := make([]byte, 0, 32)
532 b = strconv.AppendInt(b, int64(t.Hour()), 10)
533 b = append(b, sk.timeSeparator...)
539 b = strconv.AppendInt(b, int64(t.Minute()), 10)
544 // FmtTimeMedium returns the medium time representation of 't' for 'sk_SK'
545 func (sk *sk_SK) FmtTimeMedium(t time.Time) string {
547 b := make([]byte, 0, 32)
549 b = strconv.AppendInt(b, int64(t.Hour()), 10)
550 b = append(b, sk.timeSeparator...)
556 b = strconv.AppendInt(b, int64(t.Minute()), 10)
557 b = append(b, sk.timeSeparator...)
563 b = strconv.AppendInt(b, int64(t.Second()), 10)
568 // FmtTimeLong returns the long time representation of 't' for 'sk_SK'
569 func (sk *sk_SK) FmtTimeLong(t time.Time) string {
571 b := make([]byte, 0, 32)
573 b = strconv.AppendInt(b, int64(t.Hour()), 10)
574 b = append(b, sk.timeSeparator...)
580 b = strconv.AppendInt(b, int64(t.Minute()), 10)
581 b = append(b, sk.timeSeparator...)
587 b = strconv.AppendInt(b, int64(t.Second()), 10)
588 b = append(b, []byte{0x20}...)
596 // FmtTimeFull returns the full time representation of 't' for 'sk_SK'
597 func (sk *sk_SK) FmtTimeFull(t time.Time) string {
599 b := make([]byte, 0, 32)
601 b = strconv.AppendInt(b, int64(t.Hour()), 10)
602 b = append(b, sk.timeSeparator...)
608 b = strconv.AppendInt(b, int64(t.Minute()), 10)
609 b = append(b, sk.timeSeparator...)
615 b = strconv.AppendInt(b, int64(t.Second()), 10)
616 b = append(b, []byte{0x20}...)
620 if btz, ok := sk.timezones[tz]; ok {
621 b = append(b, btz...)