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_Arab' 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", "؋", "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"},
59 currencyPositiveSuffix: " ",
60 currencyNegativeSuffix: " ",
61 monthsAbbreviated: []string{"", "جنو", "فبر", "مار", "اپر", "می", "جون", "جول", "اگس", "سپت", "اکت", "نوم", "دسم"},
62 monthsNarrow: []string{"", "Y", "F", "M", "A", "M", "I", "I", "A", "S", "O", "N", "D"},
63 monthsWide: []string{"", "جنوری", "فبروری", "مارچ", "اپریل", "می", "جون", "جولای", "اگست", "سپتمبر", "اکتوبر", "نومبر", "دسمبر"},
64 daysAbbreviated: []string{"ی.", "د.", "س.", "چ.", "پ.", "ج.", "ش."},
65 daysNarrow: []string{"Y", "D", "S", "C", "P", "J", "S"},
66 daysShort: []string{"Ya", "Du", "Se", "Ch", "Pa", "Ju", "Sh"},
67 daysWide: []string{"یکشنبه", "دوشنبه", "سه\u200cشنبه", "چهارشنبه", "پنجشنبه", "جمعه", "شنبه"},
68 periodsAbbreviated: []string{"TO", "TK"},
69 periodsNarrow: []string{"TO", "TK"},
70 periodsWide: []string{"TO", "TK"},
71 erasAbbreviated: []string{"ق.م.", "م."},
72 erasNarrow: []string{"", ""},
73 erasWide: []string{"", ""},
74 timezones: map[string]string{"LHST": "Lord-Xau standart vaqti", "HNOG": "G‘arbiy Grenlandiya standart vaqti", "PDT": "Tinch okeani yozgi vaqti", "CDT": "Markaziy Amerika yozgi vaqti", "AWST": "G‘arbiy Avstraliya standart vaqti", "AWDT": "G‘arbiy Avstraliya yozgi vaqti", "HAST": "Gavayi-aleut standart vaqti", "TMT": "Turkmaniston standart vaqti", "HECU": "Kuba yozgi vaqti", "ACST": "Markaziy Avstraliya standart vaqti", "WIB": "Gʻarbiy Indoneziya vaqti", "WAT": "Gʻarbiy Afrika standart vaqti", "BOT": "Boliviya vaqti", "JST": "Yaponiya standart vaqti", "OEZ": "Sharqiy Yevropa standart vaqti", "ADT": "Atlantika yozgi vaqti", "ARST": "Argentina yozgi vaqti", "EST": "Sharqiy Amerika standart vaqti", "UYT": "Urugvay standart vaqti", "TMST": "Turkmaniston yozgi vaqti", "HNT": "Nyufaundlend standart vaqti", "ECT": "Ekvador vaqti", "CHADT": "Chatem yozgi vaqti", "ChST": "Chamorro standart vaqti", "NZST": "Yangi Zelandiya standart vaqti", "NZDT": "Yangi Zelandiya yozgi vaqti", "HNNOMX": "Shimoli-g‘arbiy Meksika standart vaqti", "HENOMX": "Shimoli-g‘arbiy Meksika yozgi vaqti", "AEST": "Sharqiy Avstraliya standart vaqti", "AKST": "Alyaska standart vaqti", "CAT": "Markaziy Afrika vaqti", "HNCU": "Kuba standart vaqti", "MESZ": "Markaziy Yevropa yozgi vaqti", "JDT": "Yaponiya yozgi vaqti", "VET": "Venesuela vaqti", "IST": "Hindiston vaqti", "COST": "Kolumbiya yozgi vaqti", "AST": "Atlantika standart vaqti", "GYT": "Gayana vaqti", "CHAST": "Chatem standart vaqti", "HADT": "Gavayi-aleut yozgi vaqti", "EAT": "Sharqiy Afrika vaqti", "SAST": "Janubiy Afrika standart vaqti", "CLST": "Chili yozgi vaqti", "GFT": "Fransuz Gvianasi vaqti", "PST": "Tinch okeani standart vaqti", "HEPM": "Sen-Pyer va Mikelon yozgi vaqti", "AEDT": "Sharqiy Avstraliya yozgi vaqti", "HEOG": "G‘arbiy Grenlandiya yozgi vaqti", "WAST": "Gʻarbiy Afrika yozgi vaqti", "HAT": "Nyufaundlend yozgi vaqti", "CLT": "Chili standart vaqti", "HKT": "Gonkong standart vaqti", "HKST": "Gonkong yozgi vaqti", "COT": "Kolumbiya standart vaqti", "BT": "Butan vaqti", "CST": "Markaziy Amerika standart vaqti", "∅∅∅": "∅∅∅", "WITA": "Markaziy Indoneziya vaqti", "ART": "Argentina standart vaqti", "EDT": "Sharqiy Amerika yozgi vaqti", "GMT": "Grinvich o‘rtacha vaqti", "ACWST": "Markaziy Avstraliya g‘arbiy standart vaqti", "UYST": "Urugvay yozgi vaqti", "LHDT": "Lord-Xau yozgi vaqti", "WART": "Gʻarbiy Argentina standart vaqti", "ACDT": "Markaziy Avstraliya yozgi vaqti", "WEZ": "G‘arbiy Yevropa standart vaqti", "SGT": "Singapur vaqti", "HNPMX": "Meksika Tinch okeani standart vaqti", "MDT": "MDT", "MYT": "Malayziya vaqti", "WARST": "Gʻarbiy Argentina yozgi vaqti", "HNEG": "Sharqiy Grenlandiya standart vaqti", "HEEG": "Sharqiy Grenlandiya yozgi vaqti", "HEPMX": "Meksika Tinch okeani yozgi vaqti", "HNPM": "Sen-Pyer va Mikelon standart vaqti", "MST": "MST", "WIT": "Sharqiy Indoneziya vaqti", "MEZ": "Markaziy Yevropa standart vaqti", "WESZ": "G‘arbiy Yevropa yozgi vaqti", "SRT": "Surinam vaqti", "ACWDT": "Markaziy Avstraliya g‘arbiy yozgi vaqti", "OESZ": "Sharqiy Yevropa yozgi vaqti", "AKDT": "Alyaska yozgi vaqti"},
78 // Locale returns the current translators string locale
79 func (uz *uz_Arab) Locale() string {
83 // PluralsCardinal returns the list of cardinal plural rules associated with 'uz_Arab'
84 func (uz *uz_Arab) PluralsCardinal() []locales.PluralRule {
85 return uz.pluralsCardinal
88 // PluralsOrdinal returns the list of ordinal plural rules associated with 'uz_Arab'
89 func (uz *uz_Arab) PluralsOrdinal() []locales.PluralRule {
90 return uz.pluralsOrdinal
93 // PluralsRange returns the list of range plural rules associated with 'uz_Arab'
94 func (uz *uz_Arab) PluralsRange() []locales.PluralRule {
95 return uz.pluralsRange
98 // CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'uz_Arab'
99 func (uz *uz_Arab) 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_Arab'
111 func (uz *uz_Arab) 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_Arab'
116 func (uz *uz_Arab) 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_Arab) MonthAbbreviated(month time.Month) string {
133 return uz.monthsAbbreviated[month]
136 // MonthsAbbreviated returns the locales abbreviated months
137 func (uz *uz_Arab) MonthsAbbreviated() []string {
138 return uz.monthsAbbreviated[1:]
141 // MonthNarrow returns the locales narrow month given the 'month' provided
142 func (uz *uz_Arab) MonthNarrow(month time.Month) string {
143 return uz.monthsNarrow[month]
146 // MonthsNarrow returns the locales narrow months
147 func (uz *uz_Arab) MonthsNarrow() []string {
148 return uz.monthsNarrow[1:]
151 // MonthWide returns the locales wide month given the 'month' provided
152 func (uz *uz_Arab) MonthWide(month time.Month) string {
153 return uz.monthsWide[month]
156 // MonthsWide returns the locales wide months
157 func (uz *uz_Arab) MonthsWide() []string {
158 return uz.monthsWide[1:]
161 // WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
162 func (uz *uz_Arab) WeekdayAbbreviated(weekday time.Weekday) string {
163 return uz.daysAbbreviated[weekday]
166 // WeekdaysAbbreviated returns the locales abbreviated weekdays
167 func (uz *uz_Arab) WeekdaysAbbreviated() []string {
168 return uz.daysAbbreviated
171 // WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
172 func (uz *uz_Arab) WeekdayNarrow(weekday time.Weekday) string {
173 return uz.daysNarrow[weekday]
176 // WeekdaysNarrow returns the locales narrow weekdays
177 func (uz *uz_Arab) WeekdaysNarrow() []string {
181 // WeekdayShort returns the locales short weekday given the 'weekday' provided
182 func (uz *uz_Arab) WeekdayShort(weekday time.Weekday) string {
183 return uz.daysShort[weekday]
186 // WeekdaysShort returns the locales short weekdays
187 func (uz *uz_Arab) WeekdaysShort() []string {
191 // WeekdayWide returns the locales wide weekday given the 'weekday' provided
192 func (uz *uz_Arab) WeekdayWide(weekday time.Weekday) string {
193 return uz.daysWide[weekday]
196 // WeekdaysWide returns the locales wide weekdays
197 func (uz *uz_Arab) WeekdaysWide() []string {
201 // Decimal returns the decimal point of number
202 func (uz *uz_Arab) Decimal() string {
206 // Group returns the group of number
207 func (uz *uz_Arab) Group() string {
211 // Group returns the minus sign of number
212 func (uz *uz_Arab) Minus() string {
216 // FmtNumber returns 'num' with digits/precision of 'v' for 'uz_Arab' and handles both Whole and Real numbers based on 'v'
217 func (uz *uz_Arab) 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_Arab' 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_Arab) 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_Arab'
295 func (uz *uz_Arab) 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_Arab'
356 // in accounting notation.
357 func (uz *uz_Arab) 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_Arab'
425 func (uz *uz_Arab) FmtDateShort(t time.Time) string {
427 b := make([]byte, 0, 32)
430 b = strconv.AppendInt(b, int64(t.Year()), 10)
432 b = strconv.AppendInt(b, int64(-t.Year()), 10)
435 b = append(b, []byte{0x2f}...)
436 b = strconv.AppendInt(b, int64(t.Month()), 10)
437 b = append(b, []byte{0x2f}...)
438 b = strconv.AppendInt(b, int64(t.Day()), 10)
443 // FmtDateMedium returns the medium date representation of 't' for 'uz_Arab'
444 func (uz *uz_Arab) FmtDateMedium(t time.Time) string {
446 b := make([]byte, 0, 32)
448 b = strconv.AppendInt(b, int64(t.Day()), 10)
449 b = append(b, []byte{0x20}...)
450 b = append(b, uz.monthsAbbreviated[t.Month()]...)
451 b = append(b, []byte{0x20}...)
454 b = strconv.AppendInt(b, int64(t.Year()), 10)
456 b = strconv.AppendInt(b, int64(-t.Year()), 10)
462 // FmtDateLong returns the long date representation of 't' for 'uz_Arab'
463 func (uz *uz_Arab) FmtDateLong(t time.Time) string {
465 b := make([]byte, 0, 32)
467 b = strconv.AppendInt(b, int64(t.Day()), 10)
468 b = append(b, []byte{0x20, 0xd9, 0x86, 0xda, 0x86, 0xdb, 0x8c, 0x20}...)
469 b = append(b, uz.monthsWide[t.Month()]...)
470 b = append(b, []byte{0x20}...)
473 b = strconv.AppendInt(b, int64(t.Year()), 10)
475 b = strconv.AppendInt(b, int64(-t.Year()), 10)
481 // FmtDateFull returns the full date representation of 't' for 'uz_Arab'
482 func (uz *uz_Arab) FmtDateFull(t time.Time) string {
484 b := make([]byte, 0, 32)
487 b = strconv.AppendInt(b, int64(t.Year()), 10)
489 b = strconv.AppendInt(b, int64(-t.Year()), 10)
492 b = append(b, []byte{0x20, 0xd9, 0x86, 0xda, 0x86, 0xdb, 0x8c, 0x20, 0xdb, 0x8c, 0xdb, 0x8c, 0xd9, 0x84, 0x20}...)
493 b = strconv.AppendInt(b, int64(t.Day()), 10)
494 b = append(b, []byte{0x20, 0xd9, 0x86, 0xda, 0x86, 0xdb, 0x8c, 0x20}...)
495 b = append(b, uz.monthsWide[t.Month()]...)
496 b = append(b, []byte{0x20}...)
497 b = append(b, uz.daysWide[t.Weekday()]...)
498 b = append(b, []byte{0x20, 0xda, 0xa9, 0xd9, 0x88, 0xd9, 0x86, 0xdb, 0x8c}...)
503 // FmtTimeShort returns the short time representation of 't' for 'uz_Arab'
504 func (uz *uz_Arab) FmtTimeShort(t time.Time) string {
506 b := make([]byte, 0, 32)
508 b = strconv.AppendInt(b, int64(t.Hour()), 10)
509 b = append(b, uz.timeSeparator...)
515 b = strconv.AppendInt(b, int64(t.Minute()), 10)
520 // FmtTimeMedium returns the medium time representation of 't' for 'uz_Arab'
521 func (uz *uz_Arab) FmtTimeMedium(t time.Time) string {
523 b := make([]byte, 0, 32)
525 b = strconv.AppendInt(b, int64(t.Hour()), 10)
526 b = append(b, uz.timeSeparator...)
532 b = strconv.AppendInt(b, int64(t.Minute()), 10)
533 b = append(b, uz.timeSeparator...)
539 b = strconv.AppendInt(b, int64(t.Second()), 10)
544 // FmtTimeLong returns the long time representation of 't' for 'uz_Arab'
545 func (uz *uz_Arab) FmtTimeLong(t time.Time) string {
547 b := make([]byte, 0, 32)
549 b = strconv.AppendInt(b, int64(t.Hour()), 10)
550 b = append(b, uz.timeSeparator...)
556 b = strconv.AppendInt(b, int64(t.Minute()), 10)
557 b = append(b, uz.timeSeparator...)
563 b = strconv.AppendInt(b, int64(t.Second()), 10)
564 b = append(b, []byte{0x20, 0x28}...)
569 b = append(b, []byte{0x29}...)
574 // FmtTimeFull returns the full time representation of 't' for 'uz_Arab'
575 func (uz *uz_Arab) FmtTimeFull(t time.Time) string {
577 b := make([]byte, 0, 32)
579 b = strconv.AppendInt(b, int64(t.Hour()), 10)
580 b = append(b, uz.timeSeparator...)
586 b = strconv.AppendInt(b, int64(t.Minute()), 10)
587 b = append(b, uz.timeSeparator...)
593 b = strconv.AppendInt(b, int64(t.Second()), 10)
594 b = append(b, []byte{0x20, 0x28}...)
598 if btz, ok := uz.timezones[tz]; ok {
599 b = append(b, btz...)
604 b = append(b, []byte{0x29}...)