1 package ff_Latn_GH
2
3 import (
4 "math"
5 "strconv"
6 "time"
7
8 "github.com/go-playground/locales"
9 "github.com/go-playground/locales/currency"
10 )
11
12 type ff_Latn_GH struct {
13 locale string
14 pluralsCardinal []locales.PluralRule
15 pluralsOrdinal []locales.PluralRule
16 pluralsRange []locales.PluralRule
17 decimal string
18 group string
19 minus string
20 percent string
21 perMille string
22 timeSeparator string
23 inifinity string
24 currencies []string
25 currencyPositiveSuffix string
26 currencyNegativeSuffix string
27 monthsAbbreviated []string
28 monthsNarrow []string
29 monthsWide []string
30 daysAbbreviated []string
31 daysNarrow []string
32 daysShort []string
33 daysWide []string
34 periodsAbbreviated []string
35 periodsNarrow []string
36 periodsShort []string
37 periodsWide []string
38 erasAbbreviated []string
39 erasNarrow []string
40 erasWide []string
41 timezones map[string]string
42 }
43
44
45 func New() locales.Translator {
46 return &ff_Latn_GH{
47 locale: "ff_Latn_GH",
48 pluralsCardinal: []locales.PluralRule{2, 6},
49 pluralsOrdinal: nil,
50 pluralsRange: nil,
51 decimal: ",",
52 group: " ",
53 timeSeparator: ":",
54 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", "CNH", "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", "GH₵", "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", "MRU", "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", "STN", "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", "UYW", "UZS", "VEB", "VEF", "VES", "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"},
55 currencyPositiveSuffix: " ",
56 currencyNegativeSuffix: " ",
57 monthsAbbreviated: []string{"", "sii", "col", "mbo", "see", "duu", "kor", "mor", "juk", "slt", "yar", "jol", "bow"},
58 monthsNarrow: []string{"", "s", "c", "m", "s", "d", "k", "m", "j", "s", "y", "j", "b"},
59 monthsWide: []string{"", "siilo", "colte", "mbooy", "seeɗto", "duujal", "korse", "morso", "juko", "siilto", "yarkomaa", "jolal", "bowte"},
60 daysAbbreviated: []string{"dew", "aaɓ", "maw", "nje", "naa", "mwd", "hbi"},
61 daysNarrow: []string{"d", "a", "m", "n", "n", "m", "h"},
62 daysWide: []string{"dewo", "aaɓnde", "mawbaare", "njeslaare", "naasaande", "mawnde", "hoore-biir"},
63 periodsAbbreviated: []string{"subaka", "kikiiɗe"},
64 periodsWide: []string{"subaka", "kikiiɗe"},
65 erasAbbreviated: []string{"H-I", "C-I"},
66 erasNarrow: []string{"", ""},
67 erasWide: []string{"Hade Iisa", "Caggal Iisa"},
68 timezones: map[string]string{"ACDT": "ACDT", "ACST": "ACST", "ACWDT": "ACWDT", "ACWST": "ACWST", "ADT": "ADT", "AEDT": "AEDT", "AEST": "AEST", "AKDT": "AKDT", "AKST": "AKST", "ARST": "ARST", "ART": "ART", "AST": "AST", "AWDT": "AWDT", "AWST": "AWST", "BOT": "BOT", "BT": "BT", "CAT": "CAT", "CDT": "CDT", "CHADT": "CHADT", "CHAST": "CHAST", "CLST": "CLST", "CLT": "CLT", "COST": "COST", "COT": "COT", "CST": "CST", "ChST": "ChST", "EAT": "EAT", "ECT": "ECT", "EDT": "EDT", "EST": "EST", "GFT": "GFT", "GMT": "GMT", "GST": "GST", "GYT": "GYT", "HADT": "HADT", "HAST": "HAST", "HAT": "HAT", "HECU": "HECU", "HEEG": "HEEG", "HENOMX": "HENOMX", "HEOG": "HEOG", "HEPM": "HEPM", "HEPMX": "HEPMX", "HKST": "HKST", "HKT": "HKT", "HNCU": "HNCU", "HNEG": "HNEG", "HNNOMX": "HNNOMX", "HNOG": "HNOG", "HNPM": "HNPM", "HNPMX": "HNPMX", "HNT": "HNT", "IST": "IST", "JDT": "JDT", "JST": "JST", "LHDT": "LHDT", "LHST": "LHST", "MDT": "MDT", "MESZ": "MESZ", "MEZ": "MEZ", "MST": "MST", "MYT": "MYT", "NZDT": "NZDT", "NZST": "NZST", "OESZ": "OESZ", "OEZ": "OEZ", "PDT": "PDT", "PST": "PST", "SAST": "SAST", "SGT": "SGT", "SRT": "SRT", "TMST": "TMST", "TMT": "TMT", "UYST": "UYST", "UYT": "UYT", "VET": "VET", "WARST": "WARST", "WART": "WART", "WAST": "WAST", "WAT": "WAT", "WESZ": "WESZ", "WEZ": "WEZ", "WIB": "WIB", "WIT": "WIT", "WITA": "WITA", "∅∅∅": "∅∅∅"},
69 }
70 }
71
72
73 func (ff *ff_Latn_GH) Locale() string {
74 return ff.locale
75 }
76
77
78 func (ff *ff_Latn_GH) PluralsCardinal() []locales.PluralRule {
79 return ff.pluralsCardinal
80 }
81
82
83 func (ff *ff_Latn_GH) PluralsOrdinal() []locales.PluralRule {
84 return ff.pluralsOrdinal
85 }
86
87
88 func (ff *ff_Latn_GH) PluralsRange() []locales.PluralRule {
89 return ff.pluralsRange
90 }
91
92
93 func (ff *ff_Latn_GH) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
94
95 n := math.Abs(num)
96 i := int64(n)
97
98 if i == 0 || i == 1 {
99 return locales.PluralRuleOne
100 }
101
102 return locales.PluralRuleOther
103 }
104
105
106 func (ff *ff_Latn_GH) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
107 return locales.PluralRuleUnknown
108 }
109
110
111 func (ff *ff_Latn_GH) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
112 return locales.PluralRuleUnknown
113 }
114
115
116 func (ff *ff_Latn_GH) MonthAbbreviated(month time.Month) string {
117 return ff.monthsAbbreviated[month]
118 }
119
120
121 func (ff *ff_Latn_GH) MonthsAbbreviated() []string {
122 return ff.monthsAbbreviated[1:]
123 }
124
125
126 func (ff *ff_Latn_GH) MonthNarrow(month time.Month) string {
127 return ff.monthsNarrow[month]
128 }
129
130
131 func (ff *ff_Latn_GH) MonthsNarrow() []string {
132 return ff.monthsNarrow[1:]
133 }
134
135
136 func (ff *ff_Latn_GH) MonthWide(month time.Month) string {
137 return ff.monthsWide[month]
138 }
139
140
141 func (ff *ff_Latn_GH) MonthsWide() []string {
142 return ff.monthsWide[1:]
143 }
144
145
146 func (ff *ff_Latn_GH) WeekdayAbbreviated(weekday time.Weekday) string {
147 return ff.daysAbbreviated[weekday]
148 }
149
150
151 func (ff *ff_Latn_GH) WeekdaysAbbreviated() []string {
152 return ff.daysAbbreviated
153 }
154
155
156 func (ff *ff_Latn_GH) WeekdayNarrow(weekday time.Weekday) string {
157 return ff.daysNarrow[weekday]
158 }
159
160
161 func (ff *ff_Latn_GH) WeekdaysNarrow() []string {
162 return ff.daysNarrow
163 }
164
165
166 func (ff *ff_Latn_GH) WeekdayShort(weekday time.Weekday) string {
167 return ff.daysShort[weekday]
168 }
169
170
171 func (ff *ff_Latn_GH) WeekdaysShort() []string {
172 return ff.daysShort
173 }
174
175
176 func (ff *ff_Latn_GH) WeekdayWide(weekday time.Weekday) string {
177 return ff.daysWide[weekday]
178 }
179
180
181 func (ff *ff_Latn_GH) WeekdaysWide() []string {
182 return ff.daysWide
183 }
184
185
186 func (ff *ff_Latn_GH) Decimal() string {
187 return ff.decimal
188 }
189
190
191 func (ff *ff_Latn_GH) Group() string {
192 return ff.group
193 }
194
195
196 func (ff *ff_Latn_GH) Minus() string {
197 return ff.minus
198 }
199
200
201 func (ff *ff_Latn_GH) FmtNumber(num float64, v uint64) string {
202
203 return strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
204 }
205
206
207
208 func (ff *ff_Latn_GH) FmtPercent(num float64, v uint64) string {
209 return strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
210 }
211
212
213 func (ff *ff_Latn_GH) FmtCurrency(num float64, v uint64, currency currency.Type) string {
214
215 s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
216 symbol := ff.currencies[currency]
217 l := len(s) + len(symbol) + 3 + 2*len(s[:len(s)-int(v)-1])/3
218 count := 0
219 inWhole := v == 0
220 b := make([]byte, 0, l)
221
222 for i := len(s) - 1; i >= 0; i-- {
223
224 if s[i] == '.' {
225 b = append(b, ff.decimal[0])
226 inWhole = true
227 continue
228 }
229
230 if inWhole {
231 if count == 3 {
232 for j := len(ff.group) - 1; j >= 0; j-- {
233 b = append(b, ff.group[j])
234 }
235 count = 1
236 } else {
237 count++
238 }
239 }
240
241 b = append(b, s[i])
242 }
243
244 if num < 0 {
245 b = append(b, ff.minus[0])
246 }
247
248
249 for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
250 b[i], b[j] = b[j], b[i]
251 }
252
253 if int(v) < 2 {
254
255 if v == 0 {
256 b = append(b, ff.decimal...)
257 }
258
259 for i := 0; i < 2-int(v); i++ {
260 b = append(b, '0')
261 }
262 }
263
264 b = append(b, ff.currencyPositiveSuffix...)
265
266 b = append(b, symbol...)
267
268 return string(b)
269 }
270
271
272
273 func (ff *ff_Latn_GH) FmtAccounting(num float64, v uint64, currency currency.Type) string {
274
275 s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
276 symbol := ff.currencies[currency]
277 l := len(s) + len(symbol) + 3 + 2*len(s[:len(s)-int(v)-1])/3
278 count := 0
279 inWhole := v == 0
280 b := make([]byte, 0, l)
281
282 for i := len(s) - 1; i >= 0; i-- {
283
284 if s[i] == '.' {
285 b = append(b, ff.decimal[0])
286 inWhole = true
287 continue
288 }
289
290 if inWhole {
291 if count == 3 {
292 for j := len(ff.group) - 1; j >= 0; j-- {
293 b = append(b, ff.group[j])
294 }
295 count = 1
296 } else {
297 count++
298 }
299 }
300
301 b = append(b, s[i])
302 }
303
304 if num < 0 {
305
306 b = append(b, ff.minus[0])
307
308 }
309
310
311 for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
312 b[i], b[j] = b[j], b[i]
313 }
314
315 if int(v) < 2 {
316
317 if v == 0 {
318 b = append(b, ff.decimal...)
319 }
320
321 for i := 0; i < 2-int(v); i++ {
322 b = append(b, '0')
323 }
324 }
325
326 if num < 0 {
327 b = append(b, ff.currencyNegativeSuffix...)
328 b = append(b, symbol...)
329 } else {
330
331 b = append(b, ff.currencyPositiveSuffix...)
332 b = append(b, symbol...)
333 }
334
335 return string(b)
336 }
337
338
339 func (ff *ff_Latn_GH) FmtDateShort(t time.Time) string {
340
341 b := make([]byte, 0, 32)
342
343 b = strconv.AppendInt(b, int64(t.Day()), 10)
344 b = append(b, []byte{0x2f}...)
345 b = strconv.AppendInt(b, int64(t.Month()), 10)
346 b = append(b, []byte{0x2f}...)
347
348 if t.Year() > 0 {
349 b = strconv.AppendInt(b, int64(t.Year()), 10)
350 } else {
351 b = strconv.AppendInt(b, int64(-t.Year()), 10)
352 }
353
354 return string(b)
355 }
356
357
358 func (ff *ff_Latn_GH) FmtDateMedium(t time.Time) string {
359
360 b := make([]byte, 0, 32)
361
362 b = strconv.AppendInt(b, int64(t.Day()), 10)
363 b = append(b, []byte{0x20}...)
364 b = append(b, ff.monthsAbbreviated[t.Month()]...)
365 b = append(b, []byte{0x2c, 0x20}...)
366
367 if t.Year() > 0 {
368 b = strconv.AppendInt(b, int64(t.Year()), 10)
369 } else {
370 b = strconv.AppendInt(b, int64(-t.Year()), 10)
371 }
372
373 return string(b)
374 }
375
376
377 func (ff *ff_Latn_GH) FmtDateLong(t time.Time) string {
378
379 b := make([]byte, 0, 32)
380
381 b = strconv.AppendInt(b, int64(t.Day()), 10)
382 b = append(b, []byte{0x20}...)
383 b = append(b, ff.monthsWide[t.Month()]...)
384 b = append(b, []byte{0x20}...)
385
386 if t.Year() > 0 {
387 b = strconv.AppendInt(b, int64(t.Year()), 10)
388 } else {
389 b = strconv.AppendInt(b, int64(-t.Year()), 10)
390 }
391
392 return string(b)
393 }
394
395
396 func (ff *ff_Latn_GH) FmtDateFull(t time.Time) string {
397
398 b := make([]byte, 0, 32)
399
400 b = append(b, ff.daysWide[t.Weekday()]...)
401 b = append(b, []byte{0x20}...)
402 b = strconv.AppendInt(b, int64(t.Day()), 10)
403 b = append(b, []byte{0x20}...)
404 b = append(b, ff.monthsWide[t.Month()]...)
405 b = append(b, []byte{0x20}...)
406
407 if t.Year() > 0 {
408 b = strconv.AppendInt(b, int64(t.Year()), 10)
409 } else {
410 b = strconv.AppendInt(b, int64(-t.Year()), 10)
411 }
412
413 return string(b)
414 }
415
416
417 func (ff *ff_Latn_GH) FmtTimeShort(t time.Time) string {
418
419 b := make([]byte, 0, 32)
420
421 h := t.Hour()
422
423 if h > 12 {
424 h -= 12
425 }
426
427 b = strconv.AppendInt(b, int64(h), 10)
428 b = append(b, ff.timeSeparator...)
429
430 if t.Minute() < 10 {
431 b = append(b, '0')
432 }
433
434 b = strconv.AppendInt(b, int64(t.Minute()), 10)
435 b = append(b, []byte{0x20}...)
436
437 if t.Hour() < 12 {
438 b = append(b, ff.periodsAbbreviated[0]...)
439 } else {
440 b = append(b, ff.periodsAbbreviated[1]...)
441 }
442
443 return string(b)
444 }
445
446
447 func (ff *ff_Latn_GH) FmtTimeMedium(t time.Time) string {
448
449 b := make([]byte, 0, 32)
450
451 h := t.Hour()
452
453 if h > 12 {
454 h -= 12
455 }
456
457 b = strconv.AppendInt(b, int64(h), 10)
458 b = append(b, ff.timeSeparator...)
459
460 if t.Minute() < 10 {
461 b = append(b, '0')
462 }
463
464 b = strconv.AppendInt(b, int64(t.Minute()), 10)
465 b = append(b, ff.timeSeparator...)
466
467 if t.Second() < 10 {
468 b = append(b, '0')
469 }
470
471 b = strconv.AppendInt(b, int64(t.Second()), 10)
472 b = append(b, []byte{0x20}...)
473
474 if t.Hour() < 12 {
475 b = append(b, ff.periodsAbbreviated[0]...)
476 } else {
477 b = append(b, ff.periodsAbbreviated[1]...)
478 }
479
480 return string(b)
481 }
482
483
484 func (ff *ff_Latn_GH) FmtTimeLong(t time.Time) string {
485
486 b := make([]byte, 0, 32)
487
488 h := t.Hour()
489
490 if h > 12 {
491 h -= 12
492 }
493
494 b = strconv.AppendInt(b, int64(h), 10)
495 b = append(b, ff.timeSeparator...)
496
497 if t.Minute() < 10 {
498 b = append(b, '0')
499 }
500
501 b = strconv.AppendInt(b, int64(t.Minute()), 10)
502 b = append(b, ff.timeSeparator...)
503
504 if t.Second() < 10 {
505 b = append(b, '0')
506 }
507
508 b = strconv.AppendInt(b, int64(t.Second()), 10)
509 b = append(b, []byte{0x20}...)
510
511 if t.Hour() < 12 {
512 b = append(b, ff.periodsAbbreviated[0]...)
513 } else {
514 b = append(b, ff.periodsAbbreviated[1]...)
515 }
516
517 b = append(b, []byte{0x20}...)
518
519 tz, _ := t.Zone()
520 b = append(b, tz...)
521
522 return string(b)
523 }
524
525
526 func (ff *ff_Latn_GH) FmtTimeFull(t time.Time) string {
527
528 b := make([]byte, 0, 32)
529
530 h := t.Hour()
531
532 if h > 12 {
533 h -= 12
534 }
535
536 b = strconv.AppendInt(b, int64(h), 10)
537 b = append(b, ff.timeSeparator...)
538
539 if t.Minute() < 10 {
540 b = append(b, '0')
541 }
542
543 b = strconv.AppendInt(b, int64(t.Minute()), 10)
544 b = append(b, ff.timeSeparator...)
545
546 if t.Second() < 10 {
547 b = append(b, '0')
548 }
549
550 b = strconv.AppendInt(b, int64(t.Second()), 10)
551 b = append(b, []byte{0x20}...)
552
553 if t.Hour() < 12 {
554 b = append(b, ff.periodsAbbreviated[0]...)
555 } else {
556 b = append(b, ff.periodsAbbreviated[1]...)
557 }
558
559 b = append(b, []byte{0x20}...)
560
561 tz, _ := t.Zone()
562
563 if btz, ok := ff.timezones[tz]; ok {
564 b = append(b, btz...)
565 } else {
566 b = append(b, tz...)
567 }
568
569 return string(b)
570 }
571
View as plain text