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
24 currencies []string // idx = enum of currency code
25 currencyPositiveSuffix string
26 currencyNegativeSuffix string
27 monthsAbbreviated []string
30 daysAbbreviated []string
34 periodsAbbreviated []string
35 periodsNarrow []string
38 erasAbbreviated []string
41 timezones map[string]string
44 // New returns a new instance of translator for the 'uz_Cyrl' locale
45 func New() locales.Translator {
48 pluralsCardinal: []locales.PluralRule{2, 6},
49 pluralsOrdinal: []locales.PluralRule{6},
50 pluralsRange: []locales.PluralRule{2, 6},
58 currencies: []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "A$", "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", "R$", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CA$", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNX", "CN¥", "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", "€", "FIM", "FJD", "FKP", "FRF", "£", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HK$", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "₪", "₹", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JP¥", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "₩", "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", "MX$", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZ$", "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", "฿", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "NT$", "TZS", "UAH", "UAK", "UGS", "UGX", "US$", "USN", "USS", "UYI", "UYP", "UYU", "сўм", "VEB", "VEF", "₫", "VNN", "VUV", "WST", "FCFA", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "EC$", "XDR", "XEU", "XFO", "XFU", "CFA", "XPD", "CFPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
59 currencyPositiveSuffix: " ",
60 currencyNegativeSuffix: " ",
61 monthsAbbreviated: []string{"", "янв", "фев", "мар", "апр", "май", "июн", "июл", "авг", "сен", "окт", "ноя", "дек"},
62 monthsNarrow: []string{"", "Я", "Ф", "М", "А", "М", "И", "И", "А", "С", "О", "Н", "Д"},
63 monthsWide: []string{"", "январ", "феврал", "март", "апрел", "май", "июн", "июл", "август", "сентябр", "октябр", "ноябр", "декабр"},
64 daysAbbreviated: []string{"якш", "душ", "сеш", "чор", "пай", "жум", "шан"},
65 daysNarrow: []string{"Я", "Д", "С", "Ч", "П", "Ж", "Ш"},
66 daysShort: []string{"Як", "Ду", "Се", "Чо", "Па", "Жу", "Ша"},
67 daysWide: []string{"якшанба", "душанба", "сешанба", "чоршанба", "пайшанба", "жума", "шанба"},
68 periodsAbbreviated: []string{"ТО", "ТК"},
69 periodsNarrow: []string{"ТО", "ТК"},
70 periodsWide: []string{"ТО", "ТК"},
71 erasAbbreviated: []string{"", ""},
72 erasNarrow: []string{"", ""},
73 erasWide: []string{"", ""},
74 timezones: map[string]string{"HNNOMX": "Shimoli-g‘arbiy Meksika standart vaqti", "EDT": "Шимолий Америка шарқий кундузги вақти", "ECT": "Эквадор вақти", "AKST": "Аляска стандарт вақти", "WESZ": "Ғарбий Европа ёзги вақти", "HNPMX": "Meksika Tinch okeani standart vaqti", "WIB": "Ғарбий Индонезия вақти", "PST": "Шимолий Америка тинч океани стандарт вақти", "CHAST": "Чатхам стандарт вақти", "CLT": "Чили стандарт вақти", "GYT": "Гайана вақти", "TMT": "Туркманистон стандарт вақти", "WITA": "Марказий Индонезия вақти", "AST": "Атлантика стандарт вақти", "ChST": "Каморро вақти", "AWDT": "Ғарбий Австралия кундузги вақти", "CDT": "Шимолий Америка марказий кундузги вақти", "VET": "Венесуэла вақти", "LHST": "Лорд Хове стандарт вақти", "IST": "Ҳиндистон вақти", "HAT": "Ньюфаундленд кундузги вақти", "HEPMX": "Meksika Tinch okeani yozgi vaqti", "WAT": "Ғарбий Африка стандарт вақти", "EAT": "Шарқий Африка вақти", "HAST": "Гавайи-алеут стандарт вақти", "HADT": "Гавайи-алеут кундузги вақти", "WAST": "Ғарбий Африка ёзги вақти", "CAT": "Марказий Африка вақти", "WIT": "Шарқий Индонезия вақти", "ACWST": "Марказий Австралия Ғарбий стандарт вақти", "NZST": "Янги Зеландия стандарт вақти", "TMST": "Туркманистон ёзги вақти", "HENOMX": "Shimoli-g‘arbiy Meksika yozgi vaqti", "LHDT": "Лорд Хове кундузги вақти", "ARST": "Аргентина ёзги вақти", "HNCU": "Куба стандарт вақти", "SRT": "Суринам вақти", "SGT": "Сингапур вақти", "WEZ": "Ғарбий Европа стандарт вақти", "MYT": "Малайзия вақти", "HEEG": "Шарқий Гренландия ёзги вақти", "COST": "Колумбия ёзги вақти", "HNT": "Ньюфаундленд стандарт вақти", "HNPM": "Сент-Пьер ва Микелон стандарт вақти", "WART": "Ғарбий Аргентина стандарт вақти", "JST": "Япония стандарт вақти", "HNOG": "Ғарбий Гренландия стандарт вақти", "AEST": "Шарқий Австралия стандарт вақти", "HKST": "Гонконг ёзги вақти", "EST": "Шимолий Америка шарқий стандарт вақти", "MESZ": "Марказий Европа ёзги вақти", "WARST": "Ғарбий Аргентина ёзги вақти", "HEOG": "Ғарбий Гренландия ёзги вақти", "HECU": "Куба кундузги вақти", "MDT": "MDT", "MST": "MST", "OEZ": "Шарқий Европа стандарт вақти", "AEDT": "Шарқий Австралия кундузги вақти", "COT": "Колумбия стандарт вақти", "BT": "Бутан вақти", "HNEG": "Шарқий Гренландия стандарт вақти", "HEPM": "Сент-Пьер ва Микелон кундузги вақти", "NZDT": "Янги Зеландия кундузги вақти", "BOT": "Боливия вақти", "UYT": "Уругвай стандарт вақти", "AKDT": "Аляска кундузги вақти", "PDT": "Шимолий Америка тинч океани кундузги вақти", "GMT": "Гринвич вақти", "CHADT": "Чатхам кундузги вақти", "AWST": "Ғарбий Австралия стандарт вақти", "JDT": "Япония кундузги вақти", "ART": "Аргентина стандарт вақти", "GFT": "Француз Гвианаси вақти", "HKT": "Гонконг стандарт вақти", "CST": "Шимолий Америка марказий стандарт вақти", "SAST": "Жанубий Африка вақти", "∅∅∅": "Амазонка ёзги вақти", "UYST": "Уругвай ёзги вақти", "ACDT": "Марказий Австралия кундузги вақти", "ACWDT": "Марказий Австралия Ғарбий кундузги вақти", "MEZ": "Марказий Европа стандарт вақти", "OESZ": "Шарқий Европа ёзги вақти", "ADT": "Атлантика кундузги вақти", "CLST": "Чили ёзги вақти", "ACST": "Марказий Австралия стандарт вақти"},
78 // Locale returns the current translators string locale
79 func (uz *uz_Cyrl) Locale() string {
83 // PluralsCardinal returns the list of cardinal plural rules associated with 'uz_Cyrl'
84 func (uz *uz_Cyrl) PluralsCardinal() []locales.PluralRule {
85 return uz.pluralsCardinal
88 // PluralsOrdinal returns the list of ordinal plural rules associated with 'uz_Cyrl'
89 func (uz *uz_Cyrl) PluralsOrdinal() []locales.PluralRule {
90 return uz.pluralsOrdinal
93 // PluralsRange returns the list of range plural rules associated with 'uz_Cyrl'
94 func (uz *uz_Cyrl) PluralsRange() []locales.PluralRule {
95 return uz.pluralsRange
98 // CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'uz_Cyrl'
99 func (uz *uz_Cyrl) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
104 return locales.PluralRuleOne
107 return locales.PluralRuleOther
110 // OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'uz_Cyrl'
111 func (uz *uz_Cyrl) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
112 return locales.PluralRuleOther
115 // RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'uz_Cyrl'
116 func (uz *uz_Cyrl) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
118 start := uz.CardinalPluralRule(num1, v1)
119 end := uz.CardinalPluralRule(num2, v2)
121 if start == locales.PluralRuleOne && end == locales.PluralRuleOther {
122 return locales.PluralRuleOther
123 } else if start == locales.PluralRuleOther && end == locales.PluralRuleOne {
124 return locales.PluralRuleOne
127 return locales.PluralRuleOther
131 // MonthAbbreviated returns the locales abbreviated month given the 'month' provided
132 func (uz *uz_Cyrl) MonthAbbreviated(month time.Month) string {
133 return uz.monthsAbbreviated[month]
136 // MonthsAbbreviated returns the locales abbreviated months
137 func (uz *uz_Cyrl) MonthsAbbreviated() []string {
138 return uz.monthsAbbreviated[1:]
141 // MonthNarrow returns the locales narrow month given the 'month' provided
142 func (uz *uz_Cyrl) MonthNarrow(month time.Month) string {
143 return uz.monthsNarrow[month]
146 // MonthsNarrow returns the locales narrow months
147 func (uz *uz_Cyrl) MonthsNarrow() []string {
148 return uz.monthsNarrow[1:]
151 // MonthWide returns the locales wide month given the 'month' provided
152 func (uz *uz_Cyrl) MonthWide(month time.Month) string {
153 return uz.monthsWide[month]
156 // MonthsWide returns the locales wide months
157 func (uz *uz_Cyrl) MonthsWide() []string {
158 return uz.monthsWide[1:]
161 // WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
162 func (uz *uz_Cyrl) WeekdayAbbreviated(weekday time.Weekday) string {
163 return uz.daysAbbreviated[weekday]
166 // WeekdaysAbbreviated returns the locales abbreviated weekdays
167 func (uz *uz_Cyrl) WeekdaysAbbreviated() []string {
168 return uz.daysAbbreviated
171 // WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
172 func (uz *uz_Cyrl) WeekdayNarrow(weekday time.Weekday) string {
173 return uz.daysNarrow[weekday]
176 // WeekdaysNarrow returns the locales narrow weekdays
177 func (uz *uz_Cyrl) WeekdaysNarrow() []string {
181 // WeekdayShort returns the locales short weekday given the 'weekday' provided
182 func (uz *uz_Cyrl) WeekdayShort(weekday time.Weekday) string {
183 return uz.daysShort[weekday]
186 // WeekdaysShort returns the locales short weekdays
187 func (uz *uz_Cyrl) WeekdaysShort() []string {
191 // WeekdayWide returns the locales wide weekday given the 'weekday' provided
192 func (uz *uz_Cyrl) WeekdayWide(weekday time.Weekday) string {
193 return uz.daysWide[weekday]
196 // WeekdaysWide returns the locales wide weekdays
197 func (uz *uz_Cyrl) WeekdaysWide() []string {
201 // Decimal returns the decimal point of number
202 func (uz *uz_Cyrl) Decimal() string {
206 // Group returns the group of number
207 func (uz *uz_Cyrl) Group() string {
211 // Group returns the minus sign of number
212 func (uz *uz_Cyrl) Minus() string {
216 // FmtNumber returns 'num' with digits/precision of 'v' for 'uz_Cyrl' and handles both Whole and Real numbers based on 'v'
217 func (uz *uz_Cyrl) FmtNumber(num float64, v uint64) string {
219 s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
220 l := len(s) + 3 + 2*len(s[:len(s)-int(v)-1])/3
223 b := make([]byte, 0, l)
225 for i := len(s) - 1; i >= 0; i-- {
228 for j := len(uz.decimal) - 1; j >= 0; j-- {
229 b = append(b, uz.decimal[j])
237 for j := len(uz.group) - 1; j >= 0; j-- {
238 b = append(b, uz.group[j])
250 b = append(b, uz.minus[0])
254 for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
255 b[i], b[j] = b[j], b[i]
261 // FmtPercent returns 'num' with digits/precision of 'v' for 'uz_Cyrl' and handles both Whole and Real numbers based on 'v'
262 // NOTE: 'num' passed into FmtPercent is assumed to be in percent already
263 func (uz *uz_Cyrl) FmtPercent(num float64, v uint64) string {
264 s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
266 b := make([]byte, 0, l)
268 for i := len(s) - 1; i >= 0; i-- {
271 for j := len(uz.decimal) - 1; j >= 0; j-- {
272 b = append(b, uz.decimal[j])
281 b = append(b, uz.minus[0])
285 for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
286 b[i], b[j] = b[j], b[i]
289 b = append(b, uz.percent...)
294 // FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'uz_Cyrl'
295 func (uz *uz_Cyrl) FmtCurrency(num float64, v uint64, currency currency.Type) string {
297 s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
298 symbol := uz.currencies[currency]
299 l := len(s) + len(symbol) + 5 + 2*len(s[:len(s)-int(v)-1])/3
302 b := make([]byte, 0, l)
304 for i := len(s) - 1; i >= 0; i-- {
307 for j := len(uz.decimal) - 1; j >= 0; j-- {
308 b = append(b, uz.decimal[j])
316 for j := len(uz.group) - 1; j >= 0; j-- {
317 b = append(b, uz.group[j])
329 b = append(b, uz.minus[0])
333 for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
334 b[i], b[j] = b[j], b[i]
340 b = append(b, uz.decimal...)
343 for i := 0; i < 2-int(v); i++ {
348 b = append(b, uz.currencyPositiveSuffix...)
350 b = append(b, symbol...)
355 // FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'uz_Cyrl'
356 // in accounting notation.
357 func (uz *uz_Cyrl) FmtAccounting(num float64, v uint64, currency currency.Type) string {
359 s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
360 symbol := uz.currencies[currency]
361 l := len(s) + len(symbol) + 5 + 2*len(s[:len(s)-int(v)-1])/3
364 b := make([]byte, 0, l)
366 for i := len(s) - 1; i >= 0; i-- {
369 for j := len(uz.decimal) - 1; j >= 0; j-- {
370 b = append(b, uz.decimal[j])
378 for j := len(uz.group) - 1; j >= 0; j-- {
379 b = append(b, uz.group[j])
392 b = append(b, uz.minus[0])
397 for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
398 b[i], b[j] = b[j], b[i]
404 b = append(b, uz.decimal...)
407 for i := 0; i < 2-int(v); i++ {
413 b = append(b, uz.currencyNegativeSuffix...)
414 b = append(b, symbol...)
417 b = append(b, uz.currencyPositiveSuffix...)
418 b = append(b, symbol...)
424 // FmtDateShort returns the short date representation of 't' for 'uz_Cyrl'
425 func (uz *uz_Cyrl) FmtDateShort(t time.Time) string {
427 b := make([]byte, 0, 32)
433 b = strconv.AppendInt(b, int64(t.Day()), 10)
434 b = append(b, []byte{0x2f}...)
440 b = strconv.AppendInt(b, int64(t.Month()), 10)
442 b = append(b, []byte{0x2f}...)
445 b = append(b, strconv.Itoa(t.Year())[2:]...)
447 b = append(b, strconv.Itoa(t.Year())[1:]...)
453 // FmtDateMedium returns the medium date representation of 't' for 'uz_Cyrl'
454 func (uz *uz_Cyrl) FmtDateMedium(t time.Time) string {
456 b := make([]byte, 0, 32)
458 b = strconv.AppendInt(b, int64(t.Day()), 10)
459 b = append(b, []byte{0x20}...)
460 b = append(b, uz.monthsAbbreviated[t.Month()]...)
461 b = append(b, []byte{0x2c, 0x20}...)
464 b = strconv.AppendInt(b, int64(t.Year()), 10)
466 b = strconv.AppendInt(b, int64(-t.Year()), 10)
472 // FmtDateLong returns the long date representation of 't' for 'uz_Cyrl'
473 func (uz *uz_Cyrl) FmtDateLong(t time.Time) string {
475 b := make([]byte, 0, 32)
477 b = strconv.AppendInt(b, int64(t.Day()), 10)
478 b = append(b, []byte{0x20}...)
479 b = append(b, uz.monthsWide[t.Month()]...)
480 b = append(b, []byte{0x2c, 0x20}...)
483 b = strconv.AppendInt(b, int64(t.Year()), 10)
485 b = strconv.AppendInt(b, int64(-t.Year()), 10)
491 // FmtDateFull returns the full date representation of 't' for 'uz_Cyrl'
492 func (uz *uz_Cyrl) FmtDateFull(t time.Time) string {
494 b := make([]byte, 0, 32)
496 b = append(b, uz.daysWide[t.Weekday()]...)
497 b = append(b, []byte{0x2c, 0x20}...)
503 b = strconv.AppendInt(b, int64(t.Day()), 10)
504 b = append(b, []byte{0x20}...)
505 b = append(b, uz.monthsWide[t.Month()]...)
506 b = append(b, []byte{0x2c, 0x20}...)
509 b = strconv.AppendInt(b, int64(t.Year()), 10)
511 b = strconv.AppendInt(b, int64(-t.Year()), 10)
517 // FmtTimeShort returns the short time representation of 't' for 'uz_Cyrl'
518 func (uz *uz_Cyrl) FmtTimeShort(t time.Time) string {
520 b := make([]byte, 0, 32)
526 b = strconv.AppendInt(b, int64(t.Hour()), 10)
527 b = append(b, uz.timeSeparator...)
533 b = strconv.AppendInt(b, int64(t.Minute()), 10)
538 // FmtTimeMedium returns the medium time representation of 't' for 'uz_Cyrl'
539 func (uz *uz_Cyrl) FmtTimeMedium(t time.Time) string {
541 b := make([]byte, 0, 32)
547 b = strconv.AppendInt(b, int64(t.Hour()), 10)
548 b = append(b, uz.timeSeparator...)
554 b = strconv.AppendInt(b, int64(t.Minute()), 10)
555 b = append(b, uz.timeSeparator...)
561 b = strconv.AppendInt(b, int64(t.Second()), 10)
566 // FmtTimeLong returns the long time representation of 't' for 'uz_Cyrl'
567 func (uz *uz_Cyrl) FmtTimeLong(t time.Time) string {
569 b := make([]byte, 0, 32)
575 b = strconv.AppendInt(b, int64(t.Hour()), 10)
576 b = append(b, uz.timeSeparator...)
582 b = strconv.AppendInt(b, int64(t.Minute()), 10)
583 b = append(b, uz.timeSeparator...)
589 b = strconv.AppendInt(b, int64(t.Second()), 10)
590 b = append(b, []byte{0x20, 0x28}...)
595 b = append(b, []byte{0x29}...)
600 // FmtTimeFull returns the full time representation of 't' for 'uz_Cyrl'
601 func (uz *uz_Cyrl) FmtTimeFull(t time.Time) string {
603 b := make([]byte, 0, 32)
609 b = strconv.AppendInt(b, int64(t.Hour()), 10)
610 b = append(b, uz.timeSeparator...)
616 b = strconv.AppendInt(b, int64(t.Minute()), 10)
617 b = append(b, uz.timeSeparator...)
623 b = strconv.AppendInt(b, int64(t.Second()), 10)
624 b = append(b, []byte{0x20, 0x28}...)
628 if btz, ok := uz.timezones[tz]; ok {
629 b = append(b, btz...)
634 b = append(b, []byte{0x29}...)