OSDN Git Service

new repo
[bytom/vapor.git] / vendor / github.com / go-playground / locales / te_IN / te_IN.go
1 package te_IN
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 te_IN 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         currencyNegativePrefix 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 // New returns a new instance of translator for the 'te_IN' locale
45 func New() locales.Translator {
46         return &te_IN{
47                 locale:                 "te_IN",
48                 pluralsCardinal:        []locales.PluralRule{2, 6},
49                 pluralsOrdinal:         []locales.PluralRule{6},
50                 pluralsRange:           []locales.PluralRule{2, 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                 currencyNegativePrefix: "(",
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{"AM", "PM"},
69                 periodsNarrow:          []string{"ఉ", "సా"},
70                 periodsWide:            []string{"AM", "PM"},
71                 erasAbbreviated:        []string{"క్రీపూ", "క్రీశ"},
72                 erasNarrow:             []string{"", ""},
73                 erasWide:               []string{"క్రీస్తు పూర్వం", "క్రీస్తు శకం"},
74                 timezones:              map[string]string{"HEOG": "పశ్చిమ గ్రీన్\u200cల్యాండ్ వేసవి సమయం", "SGT": "సింగపూర్ ప్రామాణిక సమయం", "MDT": "మకావ్ వేసవి సమయం", "SRT": "సూరినామ్ సమయం", "OESZ": "తూర్పు యూరోపియన్ వేసవి సమయం", "WART": "పశ్చిమ అర్జెంటీనా ప్రామాణిక సమయం", "HEEG": "తూర్పు గ్రీన్\u200cల్యాండ్ వేసవి సమయం", "HADT": "హవాయ్-అల్యూషియన్ పగటి వెలుతురు సమయం", "JDT": "జపాన్ పగటి వెలుతురు సమయం", "AKDT": "అలాస్కా పగటి సమయం", "HNCU": "క్యూబా ప్రామాణిక సమయం", "BT": "భూటాన్ సమయం", "WAST": "పశ్చిమ ఆఫ్రికా వేసవి సమయం", "PST": "పసిఫిక్ ప్రామాణిక సమయం", "PDT": "పసిఫిక్ పగటి సమయం", "AEDT": "తూర్పు ఆస్ట్రేలియా పగటి సమయం", "COST": "కొలంబియా వేసవి సమయం", "AKST": "అలాస్కా ప్రామాణిక సమయం", "WEZ": "పశ్చిమ యూరోపియన్ ప్రామాణిక సమయం", "WIB": "పశ్చిమ ఇండోనేషియా సమయం", "TMT": "తుర్క్మెనిస్థాన్ ప్రామాణిక సమయం", "VET": "వెనిజులా సమయం", "AST": "అట్లాంటిక్ ప్రామాణిక సమయం", "EAT": "తూర్పు ఆఫ్రికా సమయం", "HNT": "న్యూఫౌండ్ ల్యాండ్ ప్రామాణిక సమయం", "GMT": "గ్రీన్\u200cవిచ్ సగటు సమయం", "NZST": "న్యూజిల్యాండ్ ప్రామాణిక సమయం", "ART": "అర్జెంటీనా ప్రామాణిక సమయం", "HNOG": "పశ్చిమ గ్రీన్\u200cల్యాండ్ ప్రామాణిక సమయం", "COT": "కొలంబియా ప్రామాణిక సమయం", "EST": "తూర్పు ప్రామాణిక సమయం", "UYST": "ఉరుగ్వే వేసవి సమయం", "WAT": "పశ్చిమ ఆఫ్రికా ప్రామాణిక సమయం", "ACWDT": "మధ్యమ ఆస్ట్రేలియన్ పశ్చిమ పగటి సమయం", "HAST": "హవాయ్-అల్యూషియన్ ప్రామాణిక సమయం", "NZDT": "న్యూజిల్యాండ్ పగటి వెలుతురు సమయం", "LHST": "లార్డ్ హోవ్ ప్రామాణిక సమయం", "HAT": "న్యూఫౌండ్ ల్యాండ్ పగటి సమయం", "HKST": "హాంకాంగ్ వేసవి సమయం", "EDT": "తూర్పు పగటి సమయం", "GYT": "గయానా సమయం", "ECT": "ఈక్వడార్ సమయం", "ChST": "చామర్రో ప్రామాణిక సమయం", "CHADT": "చాథమ్ పగటి వెలుతురు సమయం", "HECU": "క్యూబా పగటి సమయం", "MST": "మకావ్ ప్రామాణిక సమయం", "WARST": "పశ్చిమ అర్జెంటీనా వేసవి సమయం", "IST": "భారతదేశ సమయం", "CAT": "సెంట్రల్ ఆఫ్రికా సమయం", "MESZ": "సెంట్రల్ యూరోపియన్ వేసవి సమయం", "WITA": "సెంట్రల్ ఇండోనేషియా సమయం", "HKT": "హాంకాంగ్ ప్రామాణిక సమయం", "CLT": "చిలీ ప్రామాణిక సమయం", "GFT": "ఫ్రెంచ్ గయానా సమయం", "ACDT": "ఆస్ట్రేలియా మధ్యమ పగటి సమయం", "CDT": "మధ్యమ పగటి సమయం", "MEZ": "సెంట్రల్ యూరోపియన్ ప్రామాణిక సమయం", "ARST": "ఆర్జెంటీనా వేసవి సమయం", "CST": "మధ్యమ ప్రామాణిక సమయం", "TMST": "తుర్క్మెనిస్థాన్ వేసవి సమయం", "JST": "జపాన్ ప్రామాణిక సమయం", "AEST": "తూర్పు ఆస్ట్రేలియా ప్రామాణిక సమయం", "CLST": "చిలీ వేసవి సమయం", "ACST": "ఆస్ట్రేలియా మధ్యమ ప్రామాణిక సమయం", "∅∅∅": "అమెజాన్ వేసవి సమయం", "WESZ": "పశ్చిమ యూరోపియన్ వేసవి సమయం", "AWDT": "పశ్చిమ ఆస్ట్రేలియన్ పగటి సమయం", "WIT": "తూర్పు ఇండోనేషియా సమయం", "HENOMX": "వాయవ్య మెక్సికో పగటి సమయం", "ADT": "అట్లాంటిక్ పగటి సమయం", "SAST": "దక్షిణ ఆఫ్రికా ప్రామాణిక సమయం", "HNEG": "తూర్పు గ్రీన్\u200cల్యాండ్ ప్రామాణిక సమయం", "HNPMX": "మెక్సికన్ పసిఫిక్ ప్రామాణిక సమయం", "HEPMX": "మెక్సికన్ పసిఫిక్ పగటి సమయం", "BOT": "బొలీవియా సమయం", "AWST": "పశ్చిమ ఆస్ట్రేలియన్ ప్రామాణిక సమయం", "ACWST": "మధ్యమ ఆస్ట్రేలియా పశ్చిమ ప్రామాణిక సమయం", "OEZ": "తూర్పు యూరోపియన్ ప్రామాణిక సమయం", "CHAST": "చాథమ్ ప్రామాణిక సమయం", "MYT": "మలేషియా సమయం", "LHDT": "లార్డ్ హోవ్ పగటి సమయం", "HNPM": "సెయింట్ పియెర్ మరియు మిక్వెలాన్ ప్రామాణిక సమయం", "HEPM": "సెయింట్ పియర్ మరియు మిక్వెలాన్ పగటి సమయం", "UYT": "ఉరుగ్వే ప్రామాణిక సమయం", "HNNOMX": "వాయవ్య మెక్సికో ప్రామాణిక సమయం"},
75         }
76 }
77
78 // Locale returns the current translators string locale
79 func (te *te_IN) Locale() string {
80         return te.locale
81 }
82
83 // PluralsCardinal returns the list of cardinal plural rules associated with 'te_IN'
84 func (te *te_IN) PluralsCardinal() []locales.PluralRule {
85         return te.pluralsCardinal
86 }
87
88 // PluralsOrdinal returns the list of ordinal plural rules associated with 'te_IN'
89 func (te *te_IN) PluralsOrdinal() []locales.PluralRule {
90         return te.pluralsOrdinal
91 }
92
93 // PluralsRange returns the list of range plural rules associated with 'te_IN'
94 func (te *te_IN) PluralsRange() []locales.PluralRule {
95         return te.pluralsRange
96 }
97
98 // CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'te_IN'
99 func (te *te_IN) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
100
101         n := math.Abs(num)
102
103         if n == 1 {
104                 return locales.PluralRuleOne
105         }
106
107         return locales.PluralRuleOther
108 }
109
110 // OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'te_IN'
111 func (te *te_IN) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
112         return locales.PluralRuleOther
113 }
114
115 // RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'te_IN'
116 func (te *te_IN) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
117
118         start := te.CardinalPluralRule(num1, v1)
119         end := te.CardinalPluralRule(num2, v2)
120
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
125         }
126
127         return locales.PluralRuleOther
128
129 }
130
131 // MonthAbbreviated returns the locales abbreviated month given the 'month' provided
132 func (te *te_IN) MonthAbbreviated(month time.Month) string {
133         return te.monthsAbbreviated[month]
134 }
135
136 // MonthsAbbreviated returns the locales abbreviated months
137 func (te *te_IN) MonthsAbbreviated() []string {
138         return te.monthsAbbreviated[1:]
139 }
140
141 // MonthNarrow returns the locales narrow month given the 'month' provided
142 func (te *te_IN) MonthNarrow(month time.Month) string {
143         return te.monthsNarrow[month]
144 }
145
146 // MonthsNarrow returns the locales narrow months
147 func (te *te_IN) MonthsNarrow() []string {
148         return te.monthsNarrow[1:]
149 }
150
151 // MonthWide returns the locales wide month given the 'month' provided
152 func (te *te_IN) MonthWide(month time.Month) string {
153         return te.monthsWide[month]
154 }
155
156 // MonthsWide returns the locales wide months
157 func (te *te_IN) MonthsWide() []string {
158         return te.monthsWide[1:]
159 }
160
161 // WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
162 func (te *te_IN) WeekdayAbbreviated(weekday time.Weekday) string {
163         return te.daysAbbreviated[weekday]
164 }
165
166 // WeekdaysAbbreviated returns the locales abbreviated weekdays
167 func (te *te_IN) WeekdaysAbbreviated() []string {
168         return te.daysAbbreviated
169 }
170
171 // WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
172 func (te *te_IN) WeekdayNarrow(weekday time.Weekday) string {
173         return te.daysNarrow[weekday]
174 }
175
176 // WeekdaysNarrow returns the locales narrow weekdays
177 func (te *te_IN) WeekdaysNarrow() []string {
178         return te.daysNarrow
179 }
180
181 // WeekdayShort returns the locales short weekday given the 'weekday' provided
182 func (te *te_IN) WeekdayShort(weekday time.Weekday) string {
183         return te.daysShort[weekday]
184 }
185
186 // WeekdaysShort returns the locales short weekdays
187 func (te *te_IN) WeekdaysShort() []string {
188         return te.daysShort
189 }
190
191 // WeekdayWide returns the locales wide weekday given the 'weekday' provided
192 func (te *te_IN) WeekdayWide(weekday time.Weekday) string {
193         return te.daysWide[weekday]
194 }
195
196 // WeekdaysWide returns the locales wide weekdays
197 func (te *te_IN) WeekdaysWide() []string {
198         return te.daysWide
199 }
200
201 // Decimal returns the decimal point of number
202 func (te *te_IN) Decimal() string {
203         return te.decimal
204 }
205
206 // Group returns the group of number
207 func (te *te_IN) Group() string {
208         return te.group
209 }
210
211 // Group returns the minus sign of number
212 func (te *te_IN) Minus() string {
213         return te.minus
214 }
215
216 // FmtNumber returns 'num' with digits/precision of 'v' for 'te_IN' and handles both Whole and Real numbers based on 'v'
217 func (te *te_IN) FmtNumber(num float64, v uint64) string {
218
219         s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
220         l := len(s) + 2 + 1*len(s[:len(s)-int(v)-1])/3
221         count := 0
222         inWhole := v == 0
223         inSecondary := false
224         groupThreshold := 3
225
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, te.decimal[0])
232                         inWhole = true
233                         continue
234                 }
235
236                 if inWhole {
237
238                         if count == groupThreshold {
239                                 b = append(b, te.group[0])
240                                 count = 1
241
242                                 if !inSecondary {
243                                         inSecondary = true
244                                         groupThreshold = 2
245                                 }
246                         } else {
247                                 count++
248                         }
249                 }
250
251                 b = append(b, s[i])
252         }
253
254         if num < 0 {
255                 b = append(b, te.minus[0])
256         }
257
258         // reverse
259         for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
260                 b[i], b[j] = b[j], b[i]
261         }
262
263         return string(b)
264 }
265
266 // FmtPercent returns 'num' with digits/precision of 'v' for 'te_IN' and handles both Whole and Real numbers based on 'v'
267 // NOTE: 'num' passed into FmtPercent is assumed to be in percent already
268 func (te *te_IN) FmtPercent(num float64, v uint64) string {
269         s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
270         l := len(s) + 3
271         b := make([]byte, 0, l)
272
273         for i := len(s) - 1; i >= 0; i-- {
274
275                 if s[i] == '.' {
276                         b = append(b, te.decimal[0])
277                         continue
278                 }
279
280                 b = append(b, s[i])
281         }
282
283         if num < 0 {
284                 b = append(b, te.minus[0])
285         }
286
287         // reverse
288         for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
289                 b[i], b[j] = b[j], b[i]
290         }
291
292         b = append(b, te.percent...)
293
294         return string(b)
295 }
296
297 // FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'te_IN'
298 func (te *te_IN) FmtCurrency(num float64, v uint64, currency currency.Type) string {
299
300         s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
301         symbol := te.currencies[currency]
302         l := len(s) + len(symbol) + 2 + 1*len(s[:len(s)-int(v)-1])/3
303         count := 0
304         inWhole := v == 0
305         inSecondary := false
306         groupThreshold := 3
307
308         b := make([]byte, 0, l)
309
310         for i := len(s) - 1; i >= 0; i-- {
311
312                 if s[i] == '.' {
313                         b = append(b, te.decimal[0])
314                         inWhole = true
315                         continue
316                 }
317
318                 if inWhole {
319
320                         if count == groupThreshold {
321                                 b = append(b, te.group[0])
322                                 count = 1
323
324                                 if !inSecondary {
325                                         inSecondary = true
326                                         groupThreshold = 2
327                                 }
328                         } else {
329                                 count++
330                         }
331                 }
332
333                 b = append(b, s[i])
334         }
335
336         for j := len(symbol) - 1; j >= 0; j-- {
337                 b = append(b, symbol[j])
338         }
339
340         if num < 0 {
341                 b = append(b, te.minus[0])
342         }
343
344         // reverse
345         for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
346                 b[i], b[j] = b[j], b[i]
347         }
348
349         if int(v) < 2 {
350
351                 if v == 0 {
352                         b = append(b, te.decimal...)
353                 }
354
355                 for i := 0; i < 2-int(v); i++ {
356                         b = append(b, '0')
357                 }
358         }
359
360         return string(b)
361 }
362
363 // FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'te_IN'
364 // in accounting notation.
365 func (te *te_IN) FmtAccounting(num float64, v uint64, currency currency.Type) string {
366
367         s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
368         symbol := te.currencies[currency]
369         l := len(s) + len(symbol) + 4 + 1*len(s[:len(s)-int(v)-1])/3
370         count := 0
371         inWhole := v == 0
372         inSecondary := false
373         groupThreshold := 3
374
375         b := make([]byte, 0, l)
376
377         for i := len(s) - 1; i >= 0; i-- {
378
379                 if s[i] == '.' {
380                         b = append(b, te.decimal[0])
381                         inWhole = true
382                         continue
383                 }
384
385                 if inWhole {
386
387                         if count == groupThreshold {
388                                 b = append(b, te.group[0])
389                                 count = 1
390
391                                 if !inSecondary {
392                                         inSecondary = true
393                                         groupThreshold = 2
394                                 }
395                         } else {
396                                 count++
397                         }
398                 }
399
400                 b = append(b, s[i])
401         }
402
403         if num < 0 {
404
405                 for j := len(symbol) - 1; j >= 0; j-- {
406                         b = append(b, symbol[j])
407                 }
408
409                 b = append(b, te.currencyNegativePrefix[0])
410
411         } else {
412
413                 for j := len(symbol) - 1; j >= 0; j-- {
414                         b = append(b, symbol[j])
415                 }
416
417         }
418
419         // reverse
420         for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
421                 b[i], b[j] = b[j], b[i]
422         }
423
424         if int(v) < 2 {
425
426                 if v == 0 {
427                         b = append(b, te.decimal...)
428                 }
429
430                 for i := 0; i < 2-int(v); i++ {
431                         b = append(b, '0')
432                 }
433         }
434
435         if num < 0 {
436                 b = append(b, te.currencyNegativeSuffix...)
437         }
438
439         return string(b)
440 }
441
442 // FmtDateShort returns the short date representation of 't' for 'te_IN'
443 func (te *te_IN) FmtDateShort(t time.Time) string {
444
445         b := make([]byte, 0, 32)
446
447         if t.Day() < 10 {
448                 b = append(b, '0')
449         }
450
451         b = strconv.AppendInt(b, int64(t.Day()), 10)
452         b = append(b, []byte{0x2d}...)
453
454         if t.Month() < 10 {
455                 b = append(b, '0')
456         }
457
458         b = strconv.AppendInt(b, int64(t.Month()), 10)
459
460         b = append(b, []byte{0x2d}...)
461
462         if t.Year() > 9 {
463                 b = append(b, strconv.Itoa(t.Year())[2:]...)
464         } else {
465                 b = append(b, strconv.Itoa(t.Year())[1:]...)
466         }
467
468         return string(b)
469 }
470
471 // FmtDateMedium returns the medium date representation of 't' for 'te_IN'
472 func (te *te_IN) FmtDateMedium(t time.Time) string {
473
474         b := make([]byte, 0, 32)
475
476         b = strconv.AppendInt(b, int64(t.Day()), 10)
477         b = append(b, []byte{0x20}...)
478         b = append(b, te.monthsAbbreviated[t.Month()]...)
479         b = append(b, []byte{0x2c, 0x20}...)
480
481         if t.Year() > 0 {
482                 b = strconv.AppendInt(b, int64(t.Year()), 10)
483         } else {
484                 b = strconv.AppendInt(b, int64(-t.Year()), 10)
485         }
486
487         return string(b)
488 }
489
490 // FmtDateLong returns the long date representation of 't' for 'te_IN'
491 func (te *te_IN) FmtDateLong(t time.Time) string {
492
493         b := make([]byte, 0, 32)
494
495         b = strconv.AppendInt(b, int64(t.Day()), 10)
496         b = append(b, []byte{0x20}...)
497         b = append(b, te.monthsWide[t.Month()]...)
498         b = append(b, []byte{0x2c, 0x20}...)
499
500         if t.Year() > 0 {
501                 b = strconv.AppendInt(b, int64(t.Year()), 10)
502         } else {
503                 b = strconv.AppendInt(b, int64(-t.Year()), 10)
504         }
505
506         return string(b)
507 }
508
509 // FmtDateFull returns the full date representation of 't' for 'te_IN'
510 func (te *te_IN) FmtDateFull(t time.Time) string {
511
512         b := make([]byte, 0, 32)
513
514         b = strconv.AppendInt(b, int64(t.Day()), 10)
515         b = append(b, []byte{0x2c, 0x20}...)
516         b = append(b, te.monthsWide[t.Month()]...)
517         b = append(b, []byte{0x20}...)
518
519         if t.Year() > 0 {
520                 b = strconv.AppendInt(b, int64(t.Year()), 10)
521         } else {
522                 b = strconv.AppendInt(b, int64(-t.Year()), 10)
523         }
524
525         b = append(b, []byte{0x2c, 0x20}...)
526         b = append(b, te.daysWide[t.Weekday()]...)
527
528         return string(b)
529 }
530
531 // FmtTimeShort returns the short time representation of 't' for 'te_IN'
532 func (te *te_IN) FmtTimeShort(t time.Time) string {
533
534         b := make([]byte, 0, 32)
535
536         h := t.Hour()
537
538         if h > 12 {
539                 h -= 12
540         }
541
542         b = strconv.AppendInt(b, int64(h), 10)
543         b = append(b, te.timeSeparator...)
544
545         if t.Minute() < 10 {
546                 b = append(b, '0')
547         }
548
549         b = strconv.AppendInt(b, int64(t.Minute()), 10)
550         b = append(b, []byte{0x20}...)
551
552         if t.Hour() < 12 {
553                 b = append(b, te.periodsAbbreviated[0]...)
554         } else {
555                 b = append(b, te.periodsAbbreviated[1]...)
556         }
557
558         return string(b)
559 }
560
561 // FmtTimeMedium returns the medium time representation of 't' for 'te_IN'
562 func (te *te_IN) FmtTimeMedium(t time.Time) string {
563
564         b := make([]byte, 0, 32)
565
566         h := t.Hour()
567
568         if h > 12 {
569                 h -= 12
570         }
571
572         b = strconv.AppendInt(b, int64(h), 10)
573         b = append(b, te.timeSeparator...)
574
575         if t.Minute() < 10 {
576                 b = append(b, '0')
577         }
578
579         b = strconv.AppendInt(b, int64(t.Minute()), 10)
580         b = append(b, te.timeSeparator...)
581
582         if t.Second() < 10 {
583                 b = append(b, '0')
584         }
585
586         b = strconv.AppendInt(b, int64(t.Second()), 10)
587         b = append(b, []byte{0x20}...)
588
589         if t.Hour() < 12 {
590                 b = append(b, te.periodsAbbreviated[0]...)
591         } else {
592                 b = append(b, te.periodsAbbreviated[1]...)
593         }
594
595         return string(b)
596 }
597
598 // FmtTimeLong returns the long time representation of 't' for 'te_IN'
599 func (te *te_IN) FmtTimeLong(t time.Time) string {
600
601         b := make([]byte, 0, 32)
602
603         h := t.Hour()
604
605         if h > 12 {
606                 h -= 12
607         }
608
609         b = strconv.AppendInt(b, int64(h), 10)
610         b = append(b, te.timeSeparator...)
611
612         if t.Minute() < 10 {
613                 b = append(b, '0')
614         }
615
616         b = strconv.AppendInt(b, int64(t.Minute()), 10)
617         b = append(b, te.timeSeparator...)
618
619         if t.Second() < 10 {
620                 b = append(b, '0')
621         }
622
623         b = strconv.AppendInt(b, int64(t.Second()), 10)
624         b = append(b, []byte{0x20}...)
625
626         if t.Hour() < 12 {
627                 b = append(b, te.periodsAbbreviated[0]...)
628         } else {
629                 b = append(b, te.periodsAbbreviated[1]...)
630         }
631
632         b = append(b, []byte{0x20}...)
633
634         tz, _ := t.Zone()
635         b = append(b, tz...)
636
637         return string(b)
638 }
639
640 // FmtTimeFull returns the full time representation of 't' for 'te_IN'
641 func (te *te_IN) FmtTimeFull(t time.Time) string {
642
643         b := make([]byte, 0, 32)
644
645         h := t.Hour()
646
647         if h > 12 {
648                 h -= 12
649         }
650
651         b = strconv.AppendInt(b, int64(h), 10)
652         b = append(b, te.timeSeparator...)
653
654         if t.Minute() < 10 {
655                 b = append(b, '0')
656         }
657
658         b = strconv.AppendInt(b, int64(t.Minute()), 10)
659         b = append(b, te.timeSeparator...)
660
661         if t.Second() < 10 {
662                 b = append(b, '0')
663         }
664
665         b = strconv.AppendInt(b, int64(t.Second()), 10)
666         b = append(b, []byte{0x20}...)
667
668         if t.Hour() < 12 {
669                 b = append(b, te.periodsAbbreviated[0]...)
670         } else {
671                 b = append(b, te.periodsAbbreviated[1]...)
672         }
673
674         b = append(b, []byte{0x20}...)
675
676         tz, _ := t.Zone()
677
678         if btz, ok := te.timezones[tz]; ok {
679                 b = append(b, btz...)
680         } else {
681                 b = append(b, tz...)
682         }
683
684         return string(b)
685 }