OSDN Git Service

new repo
[bytom/vapor.git] / vendor / github.com / go-playground / locales / en_CH / en_CH.go
1 package en_CH
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 en_CH 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 // idx = enum of currency code
25         currencyPositivePrefix string
26         currencyNegativePrefix 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 // New returns a new instance of translator for the 'en_CH' locale
45 func New() locales.Translator {
46         return &en_CH{
47                 locale:                 "en_CH",
48                 pluralsCardinal:        []locales.PluralRule{2, 6},
49                 pluralsOrdinal:         []locales.PluralRule{2, 3, 4, 6},
50                 pluralsRange:           []locales.PluralRule{6},
51                 decimal:                ".",
52                 group:                  ",",
53                 minus:                  "-",
54                 percent:                "%",
55                 perMille:               "‰",
56                 timeSeparator:          ":",
57                 inifinity:              "∞",
58                 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"},
59                 currencyPositivePrefix: " ",
60                 currencyNegativePrefix: "-",
61                 monthsAbbreviated:      []string{"", "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"},
62                 monthsNarrow:           []string{"", "J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"},
63                 monthsWide:             []string{"", "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"},
64                 daysAbbreviated:        []string{"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"},
65                 daysNarrow:             []string{"S", "M", "T", "W", "T", "F", "S"},
66                 daysShort:              []string{"Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"},
67                 daysWide:               []string{"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"},
68                 periodsAbbreviated:     []string{"am", "pm"},
69                 periodsNarrow:          []string{"a", "p"},
70                 periodsWide:            []string{"am", "pm"},
71                 erasAbbreviated:        []string{"BC", "AD"},
72                 erasNarrow:             []string{"B", "A"},
73                 erasWide:               []string{"Before Christ", "Anno Domini"},
74                 timezones:              map[string]string{"MYT": "Malaysia Time", "HADT": "Hawaii-Aleutian Daylight Time", "HAT": "Newfoundland Daylight Time", "ACST": "Australian Central Standard Time", "HNCU": "Cuba Standard Time", "MST": "Macau Standard Time", "OEZ": "Eastern European Standard Time", "AKST": "Alaska Standard Time", "PDT": "Pacific Daylight Time", "HAST": "Hawaii-Aleutian Standard Time", "SAST": "South Africa Standard Time", "ECT": "Ecuador Time", "BT": "Bhutan Time", "TMT": "Turkmenistan Standard Time", "IST": "India Standard Time", "COST": "Colombia Summer Time", "WEZ": "Western European Standard Time", "HEPMX": "Mexican Pacific Daylight Time", "WART": "Western Argentina Standard Time", "WARST": "Western Argentina Summer Time", "WITA": "Central Indonesia Time", "CLT": "Chile Standard Time", "COT": "Colombia Standard Time", "OESZ": "Eastern European Summer Time", "WAST": "West Africa Summer Time", "ChST": "Chamorro Standard Time", "CHAST": "Chatham Standard Time", "HECU": "Cuba Daylight Time", "CST": "Central Standard Time", "VET": "Venezuela Time", "HENOMX": "Northwest Mexico Daylight Time", "WIB": "Western Indonesia Time", "AEDT": "Australian Eastern Daylight Time", "ARST": "Argentina Summer Time", "EAT": "East Africa Time", "BOT": "Bolivia Time", "UYST": "Uruguay Summer Time", "TMST": "Turkmenistan Summer Time", "HNNOMX": "Northwest Mexico Standard Time", "JST": "Japan Standard Time", "EDT": "Eastern Daylight Time", "AKDT": "Alaska Daylight Time", "HNPMX": "Mexican Pacific Standard Time", "HKT": "Hong Kong Standard Time", "GYT": "Guyana Time", "AWST": "Australian Western Standard Time", "AWDT": "Australian Western Daylight Time", "UYT": "Uruguay Standard Time", "WIT": "Eastern Indonesia Time", "AEST": "Australian Eastern Standard Time", "HNPM": "St. Pierre & Miquelon Standard Time", "LHST": "Lord Howe Standard Time", "SGT": "Singapore Standard Time", "WESZ": "Western European Summer Time", "GMT": "Greenwich Mean Time", "ACWDT": "Australian Central Western Daylight Time", "AST": "Atlantic Standard Time", "HNEG": "East Greenland Standard Time", "GFT": "French Guiana Time", "ACDT": "Australian Central Daylight Time", "CHADT": "Chatham Daylight Time", "∅∅∅": "Brasilia Summer Time", "MESZ": "Central European Summer Time", "HEEG": "East Greenland Summer Time", "HNT": "Newfoundland Standard Time", "CDT": "Central Daylight Time", "MEZ": "Central European Standard Time", "HNOG": "West Greenland Standard Time", "WAT": "West Africa Standard Time", "EST": "Eastern Standard Time", "SRT": "Suriname Time", "ACWST": "Australian Central Western Standard Time", "LHDT": "Lord Howe Daylight Time", "JDT": "Japan Daylight Time", "CLST": "Chile Summer Time", "HEPM": "St. Pierre & Miquelon Daylight Time", "PST": "Pacific Standard Time", "ADT": "Atlantic Daylight Time", "HKST": "Hong Kong Summer Time", "CAT": "Central Africa Time", "MDT": "Macau Summer Time", "NZST": "New Zealand Standard Time", "NZDT": "New Zealand Daylight Time", "ART": "Argentina Standard Time", "HEOG": "West Greenland Summer Time"},
75         }
76 }
77
78 // Locale returns the current translators string locale
79 func (en *en_CH) Locale() string {
80         return en.locale
81 }
82
83 // PluralsCardinal returns the list of cardinal plural rules associated with 'en_CH'
84 func (en *en_CH) PluralsCardinal() []locales.PluralRule {
85         return en.pluralsCardinal
86 }
87
88 // PluralsOrdinal returns the list of ordinal plural rules associated with 'en_CH'
89 func (en *en_CH) PluralsOrdinal() []locales.PluralRule {
90         return en.pluralsOrdinal
91 }
92
93 // PluralsRange returns the list of range plural rules associated with 'en_CH'
94 func (en *en_CH) PluralsRange() []locales.PluralRule {
95         return en.pluralsRange
96 }
97
98 // CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'en_CH'
99 func (en *en_CH) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
100
101         n := math.Abs(num)
102         i := int64(n)
103
104         if i == 1 && v == 0 {
105                 return locales.PluralRuleOne
106         }
107
108         return locales.PluralRuleOther
109 }
110
111 // OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'en_CH'
112 func (en *en_CH) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
113
114         n := math.Abs(num)
115         nMod10 := math.Mod(n, 10)
116         nMod100 := math.Mod(n, 100)
117
118         if nMod10 == 1 && nMod100 != 11 {
119                 return locales.PluralRuleOne
120         } else if nMod10 == 2 && nMod100 != 12 {
121                 return locales.PluralRuleTwo
122         } else if nMod10 == 3 && nMod100 != 13 {
123                 return locales.PluralRuleFew
124         }
125
126         return locales.PluralRuleOther
127 }
128
129 // RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'en_CH'
130 func (en *en_CH) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
131         return locales.PluralRuleOther
132 }
133
134 // MonthAbbreviated returns the locales abbreviated month given the 'month' provided
135 func (en *en_CH) MonthAbbreviated(month time.Month) string {
136         return en.monthsAbbreviated[month]
137 }
138
139 // MonthsAbbreviated returns the locales abbreviated months
140 func (en *en_CH) MonthsAbbreviated() []string {
141         return en.monthsAbbreviated[1:]
142 }
143
144 // MonthNarrow returns the locales narrow month given the 'month' provided
145 func (en *en_CH) MonthNarrow(month time.Month) string {
146         return en.monthsNarrow[month]
147 }
148
149 // MonthsNarrow returns the locales narrow months
150 func (en *en_CH) MonthsNarrow() []string {
151         return en.monthsNarrow[1:]
152 }
153
154 // MonthWide returns the locales wide month given the 'month' provided
155 func (en *en_CH) MonthWide(month time.Month) string {
156         return en.monthsWide[month]
157 }
158
159 // MonthsWide returns the locales wide months
160 func (en *en_CH) MonthsWide() []string {
161         return en.monthsWide[1:]
162 }
163
164 // WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
165 func (en *en_CH) WeekdayAbbreviated(weekday time.Weekday) string {
166         return en.daysAbbreviated[weekday]
167 }
168
169 // WeekdaysAbbreviated returns the locales abbreviated weekdays
170 func (en *en_CH) WeekdaysAbbreviated() []string {
171         return en.daysAbbreviated
172 }
173
174 // WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
175 func (en *en_CH) WeekdayNarrow(weekday time.Weekday) string {
176         return en.daysNarrow[weekday]
177 }
178
179 // WeekdaysNarrow returns the locales narrow weekdays
180 func (en *en_CH) WeekdaysNarrow() []string {
181         return en.daysNarrow
182 }
183
184 // WeekdayShort returns the locales short weekday given the 'weekday' provided
185 func (en *en_CH) WeekdayShort(weekday time.Weekday) string {
186         return en.daysShort[weekday]
187 }
188
189 // WeekdaysShort returns the locales short weekdays
190 func (en *en_CH) WeekdaysShort() []string {
191         return en.daysShort
192 }
193
194 // WeekdayWide returns the locales wide weekday given the 'weekday' provided
195 func (en *en_CH) WeekdayWide(weekday time.Weekday) string {
196         return en.daysWide[weekday]
197 }
198
199 // WeekdaysWide returns the locales wide weekdays
200 func (en *en_CH) WeekdaysWide() []string {
201         return en.daysWide
202 }
203
204 // Decimal returns the decimal point of number
205 func (en *en_CH) Decimal() string {
206         return en.decimal
207 }
208
209 // Group returns the group of number
210 func (en *en_CH) Group() string {
211         return en.group
212 }
213
214 // Group returns the minus sign of number
215 func (en *en_CH) Minus() string {
216         return en.minus
217 }
218
219 // FmtNumber returns 'num' with digits/precision of 'v' for 'en_CH' and handles both Whole and Real numbers based on 'v'
220 func (en *en_CH) FmtNumber(num float64, v uint64) string {
221
222         s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
223         l := len(s) + 2 + 1*len(s[:len(s)-int(v)-1])/3
224         count := 0
225         inWhole := v == 0
226         b := make([]byte, 0, l)
227
228         for i := len(s) - 1; i >= 0; i-- {
229
230                 if s[i] == '.' {
231                         b = append(b, en.decimal[0])
232                         inWhole = true
233                         continue
234                 }
235
236                 if inWhole {
237                         if count == 3 {
238                                 b = append(b, en.group[0])
239                                 count = 1
240                         } else {
241                                 count++
242                         }
243                 }
244
245                 b = append(b, s[i])
246         }
247
248         if num < 0 {
249                 b = append(b, en.minus[0])
250         }
251
252         // reverse
253         for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
254                 b[i], b[j] = b[j], b[i]
255         }
256
257         return string(b)
258 }
259
260 // FmtPercent returns 'num' with digits/precision of 'v' for 'en_CH' and handles both Whole and Real numbers based on 'v'
261 // NOTE: 'num' passed into FmtPercent is assumed to be in percent already
262 func (en *en_CH) FmtPercent(num float64, v uint64) string {
263         s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
264         l := len(s) + 3
265         b := make([]byte, 0, l)
266
267         for i := len(s) - 1; i >= 0; i-- {
268
269                 if s[i] == '.' {
270                         b = append(b, en.decimal[0])
271                         continue
272                 }
273
274                 b = append(b, s[i])
275         }
276
277         if num < 0 {
278                 b = append(b, en.minus[0])
279         }
280
281         // reverse
282         for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
283                 b[i], b[j] = b[j], b[i]
284         }
285
286         b = append(b, en.percent...)
287
288         return string(b)
289 }
290
291 // FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'en_CH'
292 func (en *en_CH) FmtCurrency(num float64, v uint64, currency currency.Type) string {
293
294         s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
295         symbol := en.currencies[currency]
296         l := len(s) + len(symbol) + 4 + 1*len(s[:len(s)-int(v)-1])/3
297         count := 0
298         inWhole := v == 0
299         b := make([]byte, 0, l)
300
301         for i := len(s) - 1; i >= 0; i-- {
302
303                 if s[i] == '.' {
304                         b = append(b, en.decimal[0])
305                         inWhole = true
306                         continue
307                 }
308
309                 if inWhole {
310                         if count == 3 {
311                                 b = append(b, en.group[0])
312                                 count = 1
313                         } else {
314                                 count++
315                         }
316                 }
317
318                 b = append(b, s[i])
319         }
320
321         for j := len(symbol) - 1; j >= 0; j-- {
322                 b = append(b, symbol[j])
323         }
324
325         for j := len(en.currencyPositivePrefix) - 1; j >= 0; j-- {
326                 b = append(b, en.currencyPositivePrefix[j])
327         }
328
329         if num < 0 {
330                 b = append(b, en.minus[0])
331         }
332
333         // reverse
334         for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
335                 b[i], b[j] = b[j], b[i]
336         }
337
338         if int(v) < 2 {
339
340                 if v == 0 {
341                         b = append(b, en.decimal...)
342                 }
343
344                 for i := 0; i < 2-int(v); i++ {
345                         b = append(b, '0')
346                 }
347         }
348
349         return string(b)
350 }
351
352 // FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'en_CH'
353 // in accounting notation.
354 func (en *en_CH) FmtAccounting(num float64, v uint64, currency currency.Type) string {
355
356         s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
357         symbol := en.currencies[currency]
358         l := len(s) + len(symbol) + 3 + 1*len(s[:len(s)-int(v)-1])/3
359         count := 0
360         inWhole := v == 0
361         b := make([]byte, 0, l)
362
363         for i := len(s) - 1; i >= 0; i-- {
364
365                 if s[i] == '.' {
366                         b = append(b, en.decimal[0])
367                         inWhole = true
368                         continue
369                 }
370
371                 if inWhole {
372                         if count == 3 {
373                                 b = append(b, en.group[0])
374                                 count = 1
375                         } else {
376                                 count++
377                         }
378                 }
379
380                 b = append(b, s[i])
381         }
382
383         if num < 0 {
384
385                 for j := len(symbol) - 1; j >= 0; j-- {
386                         b = append(b, symbol[j])
387                 }
388
389                 b = append(b, en.currencyNegativePrefix[0])
390
391         } else {
392
393                 for j := len(symbol) - 1; j >= 0; j-- {
394                         b = append(b, symbol[j])
395                 }
396
397                 for j := len(en.currencyPositivePrefix) - 1; j >= 0; j-- {
398                         b = append(b, en.currencyPositivePrefix[j])
399                 }
400
401         }
402
403         // reverse
404         for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
405                 b[i], b[j] = b[j], b[i]
406         }
407
408         if int(v) < 2 {
409
410                 if v == 0 {
411                         b = append(b, en.decimal...)
412                 }
413
414                 for i := 0; i < 2-int(v); i++ {
415                         b = append(b, '0')
416                 }
417         }
418
419         return string(b)
420 }
421
422 // FmtDateShort returns the short date representation of 't' for 'en_CH'
423 func (en *en_CH) FmtDateShort(t time.Time) string {
424
425         b := make([]byte, 0, 32)
426
427         b = strconv.AppendInt(b, int64(t.Month()), 10)
428         b = append(b, []byte{0x2f}...)
429         b = strconv.AppendInt(b, int64(t.Day()), 10)
430         b = append(b, []byte{0x2f}...)
431
432         if t.Year() > 9 {
433                 b = append(b, strconv.Itoa(t.Year())[2:]...)
434         } else {
435                 b = append(b, strconv.Itoa(t.Year())[1:]...)
436         }
437
438         return string(b)
439 }
440
441 // FmtDateMedium returns the medium date representation of 't' for 'en_CH'
442 func (en *en_CH) FmtDateMedium(t time.Time) string {
443
444         b := make([]byte, 0, 32)
445
446         b = append(b, en.monthsAbbreviated[t.Month()]...)
447         b = append(b, []byte{0x20}...)
448         b = strconv.AppendInt(b, int64(t.Day()), 10)
449         b = append(b, []byte{0x2c, 0x20}...)
450
451         if t.Year() > 0 {
452                 b = strconv.AppendInt(b, int64(t.Year()), 10)
453         } else {
454                 b = strconv.AppendInt(b, int64(-t.Year()), 10)
455         }
456
457         return string(b)
458 }
459
460 // FmtDateLong returns the long date representation of 't' for 'en_CH'
461 func (en *en_CH) FmtDateLong(t time.Time) string {
462
463         b := make([]byte, 0, 32)
464
465         b = append(b, en.monthsWide[t.Month()]...)
466         b = append(b, []byte{0x20}...)
467         b = strconv.AppendInt(b, int64(t.Day()), 10)
468         b = append(b, []byte{0x2c, 0x20}...)
469
470         if t.Year() > 0 {
471                 b = strconv.AppendInt(b, int64(t.Year()), 10)
472         } else {
473                 b = strconv.AppendInt(b, int64(-t.Year()), 10)
474         }
475
476         return string(b)
477 }
478
479 // FmtDateFull returns the full date representation of 't' for 'en_CH'
480 func (en *en_CH) FmtDateFull(t time.Time) string {
481
482         b := make([]byte, 0, 32)
483
484         b = append(b, en.daysWide[t.Weekday()]...)
485         b = append(b, []byte{0x2c, 0x20}...)
486         b = append(b, en.monthsWide[t.Month()]...)
487         b = append(b, []byte{0x20}...)
488         b = strconv.AppendInt(b, int64(t.Day()), 10)
489         b = append(b, []byte{0x2c, 0x20}...)
490
491         if t.Year() > 0 {
492                 b = strconv.AppendInt(b, int64(t.Year()), 10)
493         } else {
494                 b = strconv.AppendInt(b, int64(-t.Year()), 10)
495         }
496
497         return string(b)
498 }
499
500 // FmtTimeShort returns the short time representation of 't' for 'en_CH'
501 func (en *en_CH) FmtTimeShort(t time.Time) string {
502
503         b := make([]byte, 0, 32)
504
505         h := t.Hour()
506
507         if h > 12 {
508                 h -= 12
509         }
510
511         b = strconv.AppendInt(b, int64(h), 10)
512         b = append(b, en.timeSeparator...)
513
514         if t.Minute() < 10 {
515                 b = append(b, '0')
516         }
517
518         b = strconv.AppendInt(b, int64(t.Minute()), 10)
519         b = append(b, []byte{0x20}...)
520
521         if t.Hour() < 12 {
522                 b = append(b, en.periodsAbbreviated[0]...)
523         } else {
524                 b = append(b, en.periodsAbbreviated[1]...)
525         }
526
527         return string(b)
528 }
529
530 // FmtTimeMedium returns the medium time representation of 't' for 'en_CH'
531 func (en *en_CH) FmtTimeMedium(t time.Time) string {
532
533         b := make([]byte, 0, 32)
534
535         h := t.Hour()
536
537         if h > 12 {
538                 h -= 12
539         }
540
541         b = strconv.AppendInt(b, int64(h), 10)
542         b = append(b, en.timeSeparator...)
543
544         if t.Minute() < 10 {
545                 b = append(b, '0')
546         }
547
548         b = strconv.AppendInt(b, int64(t.Minute()), 10)
549         b = append(b, en.timeSeparator...)
550
551         if t.Second() < 10 {
552                 b = append(b, '0')
553         }
554
555         b = strconv.AppendInt(b, int64(t.Second()), 10)
556         b = append(b, []byte{0x20}...)
557
558         if t.Hour() < 12 {
559                 b = append(b, en.periodsAbbreviated[0]...)
560         } else {
561                 b = append(b, en.periodsAbbreviated[1]...)
562         }
563
564         return string(b)
565 }
566
567 // FmtTimeLong returns the long time representation of 't' for 'en_CH'
568 func (en *en_CH) FmtTimeLong(t time.Time) string {
569
570         b := make([]byte, 0, 32)
571
572         h := t.Hour()
573
574         if h > 12 {
575                 h -= 12
576         }
577
578         b = strconv.AppendInt(b, int64(h), 10)
579         b = append(b, en.timeSeparator...)
580
581         if t.Minute() < 10 {
582                 b = append(b, '0')
583         }
584
585         b = strconv.AppendInt(b, int64(t.Minute()), 10)
586         b = append(b, en.timeSeparator...)
587
588         if t.Second() < 10 {
589                 b = append(b, '0')
590         }
591
592         b = strconv.AppendInt(b, int64(t.Second()), 10)
593         b = append(b, []byte{0x20}...)
594
595         if t.Hour() < 12 {
596                 b = append(b, en.periodsAbbreviated[0]...)
597         } else {
598                 b = append(b, en.periodsAbbreviated[1]...)
599         }
600
601         b = append(b, []byte{0x20}...)
602
603         tz, _ := t.Zone()
604         b = append(b, tz...)
605
606         return string(b)
607 }
608
609 // FmtTimeFull returns the full time representation of 't' for 'en_CH'
610 func (en *en_CH) FmtTimeFull(t time.Time) string {
611
612         b := make([]byte, 0, 32)
613
614         h := t.Hour()
615
616         if h > 12 {
617                 h -= 12
618         }
619
620         b = strconv.AppendInt(b, int64(h), 10)
621         b = append(b, en.timeSeparator...)
622
623         if t.Minute() < 10 {
624                 b = append(b, '0')
625         }
626
627         b = strconv.AppendInt(b, int64(t.Minute()), 10)
628         b = append(b, en.timeSeparator...)
629
630         if t.Second() < 10 {
631                 b = append(b, '0')
632         }
633
634         b = strconv.AppendInt(b, int64(t.Second()), 10)
635         b = append(b, []byte{0x20}...)
636
637         if t.Hour() < 12 {
638                 b = append(b, en.periodsAbbreviated[0]...)
639         } else {
640                 b = append(b, en.periodsAbbreviated[1]...)
641         }
642
643         b = append(b, []byte{0x20}...)
644
645         tz, _ := t.Zone()
646
647         if btz, ok := en.timezones[tz]; ok {
648                 b = append(b, btz...)
649         } else {
650                 b = append(b, tz...)
651         }
652
653         return string(b)
654 }