OSDN Git Service

new repo
[bytom/vapor.git] / vendor / github.com / go-playground / locales / vi_VN / vi_VN.go
1 package vi_VN
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 vi_VN 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         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 // New returns a new instance of translator for the 'vi_VN' locale
45 func New() locales.Translator {
46         return &vi_VN{
47                 locale:                 "vi_VN",
48                 pluralsCardinal:        []locales.PluralRule{6},
49                 pluralsOrdinal:         []locales.PluralRule{2, 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                 currencyPositiveSuffix: " ",
60                 currencyNegativeSuffix: " ",
61                 monthsAbbreviated:      []string{"", "thg 1", "thg 2", "thg 3", "thg 4", "thg 5", "thg 6", "thg 7", "thg 8", "thg 9", "thg 10", "thg 11", "thg 12"},
62                 monthsNarrow:           []string{"", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"},
63                 monthsWide:             []string{"", "tháng 1", "tháng 2", "tháng 3", "tháng 4", "tháng 5", "tháng 6", "tháng 7", "tháng 8", "tháng 9", "tháng 10", "tháng 11", "tháng 12"},
64                 daysAbbreviated:        []string{"CN", "Th 2", "Th 3", "Th 4", "Th 5", "Th 6", "Th 7"},
65                 daysNarrow:             []string{"CN", "T2", "T3", "T4", "T5", "T6", "T7"},
66                 daysShort:              []string{"CN", "T2", "T3", "T4", "T5", "T6", "T7"},
67                 daysWide:               []string{"Chủ Nhật", "Thứ Hai", "Thứ Ba", "Thứ Tư", "Thứ Năm", "Thứ Sáu", "Thứ Bảy"},
68                 periodsAbbreviated:     []string{"SA", "CH"},
69                 periodsNarrow:          []string{"s", "c"},
70                 periodsWide:            []string{"SA", "CH"},
71                 erasAbbreviated:        []string{"", ""},
72                 erasNarrow:             []string{"tr. CN", "sau CN"},
73                 erasWide:               []string{"", ""},
74                 timezones:              map[string]string{"GFT": "Giờ Guiana thuộc Pháp", "GYT": "Giờ Guyana", "AKDT": "Giờ Mùa Hè Alaska", "HEPM": "Giờ Mùa Hè Saint Pierre và Miquelon", "JST": "Giờ Chuẩn Nhật Bản", "EAT": "Giờ Đông Phi", "HEPMX": "Giờ Mùa Hè Thái Bình Dương Mexico", "CDT": "Giờ mùa hè miền trung", "ACWDT": "Giờ Mùa Hè Miền Trung Tây Nước Úc", "WARST": "Giờ mùa hè miền tây Argentina", "JDT": "Giờ Mùa Hè Nhật Bản", "HEEG": "Giờ Mùa Hè Miền Đông Greenland", "CAT": "Giờ Trung Phi", "GMT": "Giờ Trung bình Greenwich", "WIT": "Giờ Miền Đông Indonesia", "WITA": "Giờ Miền Trung Indonesia", "TMT": "Giờ Chuẩn Turkmenistan", "OESZ": "Giờ Mùa Hè Đông Âu", "WAST": "Giờ Mùa Hè Tây Phi", "HKT": "Giờ Chuẩn Hồng Kông", "AKST": "Giờ Chuẩn Alaska", "ECT": "Giờ Ecuador", "CST": "Giờ chuẩn miền trung", "MEZ": "Giờ Chuẩn Trung Âu", "UYT": "Giờ Chuẩn Uruguay", "ChST": "Giờ Chamorro", "CHADT": "Giờ Mùa Hè Chatham", "HNOG": "Giờ Chuẩn Miền Tây Greenland", "ART": "Giờ Chuẩn Argentina", "SAST": "Giờ Chuẩn Nam Phi", "WIB": "Giờ Miền Tây Indonesia", "SRT": "Giờ Suriname", "AEDT": "Giờ Mùa Hè Miền Đông Nước Úc", "LHDT": "Giờ Mùa Hè Lord Howe", "AEST": "Giờ Chuẩn Miền Đông Nước Úc", "WAT": "Giờ Chuẩn Tây Phi", "HNEG": "Giờ Chuẩn Miền Đông Greenland", "HKST": "Giờ Mùa Hè Hồng Kông", "CLT": "Giờ Chuẩn Chile", "COT": "Giờ Chuẩn Colombia", "LHST": "Giờ Chuẩn Lord Howe", "BOT": "Giờ Bolivia", "EST": "Giờ chuẩn miền đông", "PST": "Giờ chuẩn Thái Bình Dương", "HECU": "Giờ Mùa Hè Cuba", "ADT": "Giờ Mùa hè Đại Tây Dương", "CHAST": "Giờ Chuẩn Chatham", "BT": "Giờ Bhutan", "MDT": "Giờ mùa hè miền núi", "ACST": "Giờ Chuẩn Miền Trung Nước Úc", "HNCU": "Giờ Chuẩn Cuba", "HNPM": "Giờ Chuẩn St. Pierre và Miquelon", "TMST": "Giờ Mùa Hè Turkmenistan", "IST": "Giờ Chuẩn Ấn Độ", "CLST": "Giờ Mùa Hè Chile", "SGT": "Giờ Singapore", "AWST": "Giờ Chuẩn Miền Tây Nước Úc", "UYST": "Giờ Mùa Hè Uruguay", "HNNOMX": "Giờ Chuẩn Tây Bắc Mexico", "HEOG": "Giờ Mùa Hè Miền Tây Greenland", "HADT": "Giờ Mùa Hè Hawaii-Aleutian", "HAT": "Giờ Mùa Hè Newfoundland", "COST": "Giờ Mùa Hè Colombia", "PDT": "Giờ Mùa hè Thái Bình Dương", "ACWST": "Giờ Chuẩn Miền Trung Tây Nước Úc", "AST": "Giờ Chuẩn Đại Tây Dương", "OEZ": "Giờ Chuẩn Đông Âu", "HNT": "Giờ Chuẩn Newfoundland", "WESZ": "Giờ Mùa hè Tây Âu", "VET": "Giờ Venezuela", "NZST": "Giờ Chuẩn New Zealand", "MST": "Giờ chuẩn miền núi", "∅∅∅": "Giờ Mùa Hè Azores", "EDT": "Giờ mùa hè miền đông", "ACDT": "Giờ Mùa Hè Miền Trung Nước Úc", "AWDT": "Giờ Mùa Hè Miền Tây Nước Úc", "MYT": "Giờ Malaysia", "HAST": "Giờ Chuẩn Hawaii-Aleutian", "NZDT": "Giờ Mùa Hè New Zealand", "HENOMX": "Giờ Mùa Hè Tây Bắc Mexico", "WART": "Giờ chuẩn miền mây Argentina", "ARST": "Giờ Mùa Hè Argentina", "WEZ": "Giờ Chuẩn Tây Âu", "HNPMX": "Giờ Chuẩn Thái Bình Dương Mexico", "MESZ": "Giờ Mùa Hè Trung Âu"},
75         }
76 }
77
78 // Locale returns the current translators string locale
79 func (vi *vi_VN) Locale() string {
80         return vi.locale
81 }
82
83 // PluralsCardinal returns the list of cardinal plural rules associated with 'vi_VN'
84 func (vi *vi_VN) PluralsCardinal() []locales.PluralRule {
85         return vi.pluralsCardinal
86 }
87
88 // PluralsOrdinal returns the list of ordinal plural rules associated with 'vi_VN'
89 func (vi *vi_VN) PluralsOrdinal() []locales.PluralRule {
90         return vi.pluralsOrdinal
91 }
92
93 // PluralsRange returns the list of range plural rules associated with 'vi_VN'
94 func (vi *vi_VN) PluralsRange() []locales.PluralRule {
95         return vi.pluralsRange
96 }
97
98 // CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'vi_VN'
99 func (vi *vi_VN) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
100         return locales.PluralRuleOther
101 }
102
103 // OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'vi_VN'
104 func (vi *vi_VN) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
105
106         n := math.Abs(num)
107
108         if n == 1 {
109                 return locales.PluralRuleOne
110         }
111
112         return locales.PluralRuleOther
113 }
114
115 // RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'vi_VN'
116 func (vi *vi_VN) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
117         return locales.PluralRuleOther
118 }
119
120 // MonthAbbreviated returns the locales abbreviated month given the 'month' provided
121 func (vi *vi_VN) MonthAbbreviated(month time.Month) string {
122         return vi.monthsAbbreviated[month]
123 }
124
125 // MonthsAbbreviated returns the locales abbreviated months
126 func (vi *vi_VN) MonthsAbbreviated() []string {
127         return vi.monthsAbbreviated[1:]
128 }
129
130 // MonthNarrow returns the locales narrow month given the 'month' provided
131 func (vi *vi_VN) MonthNarrow(month time.Month) string {
132         return vi.monthsNarrow[month]
133 }
134
135 // MonthsNarrow returns the locales narrow months
136 func (vi *vi_VN) MonthsNarrow() []string {
137         return vi.monthsNarrow[1:]
138 }
139
140 // MonthWide returns the locales wide month given the 'month' provided
141 func (vi *vi_VN) MonthWide(month time.Month) string {
142         return vi.monthsWide[month]
143 }
144
145 // MonthsWide returns the locales wide months
146 func (vi *vi_VN) MonthsWide() []string {
147         return vi.monthsWide[1:]
148 }
149
150 // WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
151 func (vi *vi_VN) WeekdayAbbreviated(weekday time.Weekday) string {
152         return vi.daysAbbreviated[weekday]
153 }
154
155 // WeekdaysAbbreviated returns the locales abbreviated weekdays
156 func (vi *vi_VN) WeekdaysAbbreviated() []string {
157         return vi.daysAbbreviated
158 }
159
160 // WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
161 func (vi *vi_VN) WeekdayNarrow(weekday time.Weekday) string {
162         return vi.daysNarrow[weekday]
163 }
164
165 // WeekdaysNarrow returns the locales narrow weekdays
166 func (vi *vi_VN) WeekdaysNarrow() []string {
167         return vi.daysNarrow
168 }
169
170 // WeekdayShort returns the locales short weekday given the 'weekday' provided
171 func (vi *vi_VN) WeekdayShort(weekday time.Weekday) string {
172         return vi.daysShort[weekday]
173 }
174
175 // WeekdaysShort returns the locales short weekdays
176 func (vi *vi_VN) WeekdaysShort() []string {
177         return vi.daysShort
178 }
179
180 // WeekdayWide returns the locales wide weekday given the 'weekday' provided
181 func (vi *vi_VN) WeekdayWide(weekday time.Weekday) string {
182         return vi.daysWide[weekday]
183 }
184
185 // WeekdaysWide returns the locales wide weekdays
186 func (vi *vi_VN) WeekdaysWide() []string {
187         return vi.daysWide
188 }
189
190 // Decimal returns the decimal point of number
191 func (vi *vi_VN) Decimal() string {
192         return vi.decimal
193 }
194
195 // Group returns the group of number
196 func (vi *vi_VN) Group() string {
197         return vi.group
198 }
199
200 // Group returns the minus sign of number
201 func (vi *vi_VN) Minus() string {
202         return vi.minus
203 }
204
205 // FmtNumber returns 'num' with digits/precision of 'v' for 'vi_VN' and handles both Whole and Real numbers based on 'v'
206 func (vi *vi_VN) FmtNumber(num float64, v uint64) string {
207
208         s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
209         l := len(s) + 2 + 1*len(s[:len(s)-int(v)-1])/3
210         count := 0
211         inWhole := v == 0
212         b := make([]byte, 0, l)
213
214         for i := len(s) - 1; i >= 0; i-- {
215
216                 if s[i] == '.' {
217                         b = append(b, vi.decimal[0])
218                         inWhole = true
219                         continue
220                 }
221
222                 if inWhole {
223                         if count == 3 {
224                                 b = append(b, vi.group[0])
225                                 count = 1
226                         } else {
227                                 count++
228                         }
229                 }
230
231                 b = append(b, s[i])
232         }
233
234         if num < 0 {
235                 b = append(b, vi.minus[0])
236         }
237
238         // reverse
239         for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
240                 b[i], b[j] = b[j], b[i]
241         }
242
243         return string(b)
244 }
245
246 // FmtPercent returns 'num' with digits/precision of 'v' for 'vi_VN' and handles both Whole and Real numbers based on 'v'
247 // NOTE: 'num' passed into FmtPercent is assumed to be in percent already
248 func (vi *vi_VN) FmtPercent(num float64, v uint64) string {
249         s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
250         l := len(s) + 3
251         b := make([]byte, 0, l)
252
253         for i := len(s) - 1; i >= 0; i-- {
254
255                 if s[i] == '.' {
256                         b = append(b, vi.decimal[0])
257                         continue
258                 }
259
260                 b = append(b, s[i])
261         }
262
263         if num < 0 {
264                 b = append(b, vi.minus[0])
265         }
266
267         // reverse
268         for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
269                 b[i], b[j] = b[j], b[i]
270         }
271
272         b = append(b, vi.percent...)
273
274         return string(b)
275 }
276
277 // FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'vi_VN'
278 func (vi *vi_VN) FmtCurrency(num float64, v uint64, currency currency.Type) string {
279
280         s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
281         symbol := vi.currencies[currency]
282         l := len(s) + len(symbol) + 4 + 1*len(s[:len(s)-int(v)-1])/3
283         count := 0
284         inWhole := v == 0
285         b := make([]byte, 0, l)
286
287         for i := len(s) - 1; i >= 0; i-- {
288
289                 if s[i] == '.' {
290                         b = append(b, vi.decimal[0])
291                         inWhole = true
292                         continue
293                 }
294
295                 if inWhole {
296                         if count == 3 {
297                                 b = append(b, vi.group[0])
298                                 count = 1
299                         } else {
300                                 count++
301                         }
302                 }
303
304                 b = append(b, s[i])
305         }
306
307         if num < 0 {
308                 b = append(b, vi.minus[0])
309         }
310
311         // reverse
312         for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
313                 b[i], b[j] = b[j], b[i]
314         }
315
316         if int(v) < 2 {
317
318                 if v == 0 {
319                         b = append(b, vi.decimal...)
320                 }
321
322                 for i := 0; i < 2-int(v); i++ {
323                         b = append(b, '0')
324                 }
325         }
326
327         b = append(b, vi.currencyPositiveSuffix...)
328
329         b = append(b, symbol...)
330
331         return string(b)
332 }
333
334 // FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'vi_VN'
335 // in accounting notation.
336 func (vi *vi_VN) FmtAccounting(num float64, v uint64, currency currency.Type) string {
337
338         s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
339         symbol := vi.currencies[currency]
340         l := len(s) + len(symbol) + 4 + 1*len(s[:len(s)-int(v)-1])/3
341         count := 0
342         inWhole := v == 0
343         b := make([]byte, 0, l)
344
345         for i := len(s) - 1; i >= 0; i-- {
346
347                 if s[i] == '.' {
348                         b = append(b, vi.decimal[0])
349                         inWhole = true
350                         continue
351                 }
352
353                 if inWhole {
354                         if count == 3 {
355                                 b = append(b, vi.group[0])
356                                 count = 1
357                         } else {
358                                 count++
359                         }
360                 }
361
362                 b = append(b, s[i])
363         }
364
365         if num < 0 {
366
367                 b = append(b, vi.minus[0])
368
369         }
370
371         // reverse
372         for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
373                 b[i], b[j] = b[j], b[i]
374         }
375
376         if int(v) < 2 {
377
378                 if v == 0 {
379                         b = append(b, vi.decimal...)
380                 }
381
382                 for i := 0; i < 2-int(v); i++ {
383                         b = append(b, '0')
384                 }
385         }
386
387         if num < 0 {
388                 b = append(b, vi.currencyNegativeSuffix...)
389                 b = append(b, symbol...)
390         } else {
391
392                 b = append(b, vi.currencyPositiveSuffix...)
393                 b = append(b, symbol...)
394         }
395
396         return string(b)
397 }
398
399 // FmtDateShort returns the short date representation of 't' for 'vi_VN'
400 func (vi *vi_VN) FmtDateShort(t time.Time) string {
401
402         b := make([]byte, 0, 32)
403
404         if t.Day() < 10 {
405                 b = append(b, '0')
406         }
407
408         b = strconv.AppendInt(b, int64(t.Day()), 10)
409         b = append(b, []byte{0x2f}...)
410
411         if t.Month() < 10 {
412                 b = append(b, '0')
413         }
414
415         b = strconv.AppendInt(b, int64(t.Month()), 10)
416
417         b = append(b, []byte{0x2f}...)
418
419         if t.Year() > 0 {
420                 b = strconv.AppendInt(b, int64(t.Year()), 10)
421         } else {
422                 b = strconv.AppendInt(b, int64(-t.Year()), 10)
423         }
424
425         return string(b)
426 }
427
428 // FmtDateMedium returns the medium date representation of 't' for 'vi_VN'
429 func (vi *vi_VN) FmtDateMedium(t time.Time) string {
430
431         b := make([]byte, 0, 32)
432
433         b = strconv.AppendInt(b, int64(t.Day()), 10)
434         b = append(b, []byte{0x20}...)
435         b = append(b, vi.monthsAbbreviated[t.Month()]...)
436         b = append(b, []byte{0x2c, 0x20}...)
437
438         if t.Year() > 0 {
439                 b = strconv.AppendInt(b, int64(t.Year()), 10)
440         } else {
441                 b = strconv.AppendInt(b, int64(-t.Year()), 10)
442         }
443
444         return string(b)
445 }
446
447 // FmtDateLong returns the long date representation of 't' for 'vi_VN'
448 func (vi *vi_VN) FmtDateLong(t time.Time) string {
449
450         b := make([]byte, 0, 32)
451
452         b = strconv.AppendInt(b, int64(t.Day()), 10)
453         b = append(b, []byte{0x20}...)
454         b = append(b, vi.monthsWide[t.Month()]...)
455         b = append(b, []byte{0x2c, 0x20}...)
456
457         if t.Year() > 0 {
458                 b = strconv.AppendInt(b, int64(t.Year()), 10)
459         } else {
460                 b = strconv.AppendInt(b, int64(-t.Year()), 10)
461         }
462
463         return string(b)
464 }
465
466 // FmtDateFull returns the full date representation of 't' for 'vi_VN'
467 func (vi *vi_VN) FmtDateFull(t time.Time) string {
468
469         b := make([]byte, 0, 32)
470
471         b = append(b, vi.daysWide[t.Weekday()]...)
472         b = append(b, []byte{0x2c, 0x20}...)
473         b = strconv.AppendInt(b, int64(t.Day()), 10)
474         b = append(b, []byte{0x20}...)
475         b = append(b, vi.monthsWide[t.Month()]...)
476         b = append(b, []byte{0x2c, 0x20}...)
477
478         if t.Year() > 0 {
479                 b = strconv.AppendInt(b, int64(t.Year()), 10)
480         } else {
481                 b = strconv.AppendInt(b, int64(-t.Year()), 10)
482         }
483
484         return string(b)
485 }
486
487 // FmtTimeShort returns the short time representation of 't' for 'vi_VN'
488 func (vi *vi_VN) FmtTimeShort(t time.Time) string {
489
490         b := make([]byte, 0, 32)
491
492         if t.Hour() < 10 {
493                 b = append(b, '0')
494         }
495
496         b = strconv.AppendInt(b, int64(t.Hour()), 10)
497         b = append(b, vi.timeSeparator...)
498
499         if t.Minute() < 10 {
500                 b = append(b, '0')
501         }
502
503         b = strconv.AppendInt(b, int64(t.Minute()), 10)
504
505         return string(b)
506 }
507
508 // FmtTimeMedium returns the medium time representation of 't' for 'vi_VN'
509 func (vi *vi_VN) FmtTimeMedium(t time.Time) string {
510
511         b := make([]byte, 0, 32)
512
513         if t.Hour() < 10 {
514                 b = append(b, '0')
515         }
516
517         b = strconv.AppendInt(b, int64(t.Hour()), 10)
518         b = append(b, vi.timeSeparator...)
519
520         if t.Minute() < 10 {
521                 b = append(b, '0')
522         }
523
524         b = strconv.AppendInt(b, int64(t.Minute()), 10)
525         b = append(b, vi.timeSeparator...)
526
527         if t.Second() < 10 {
528                 b = append(b, '0')
529         }
530
531         b = strconv.AppendInt(b, int64(t.Second()), 10)
532
533         return string(b)
534 }
535
536 // FmtTimeLong returns the long time representation of 't' for 'vi_VN'
537 func (vi *vi_VN) FmtTimeLong(t time.Time) string {
538
539         b := make([]byte, 0, 32)
540
541         if t.Hour() < 10 {
542                 b = append(b, '0')
543         }
544
545         b = strconv.AppendInt(b, int64(t.Hour()), 10)
546         b = append(b, vi.timeSeparator...)
547
548         if t.Minute() < 10 {
549                 b = append(b, '0')
550         }
551
552         b = strconv.AppendInt(b, int64(t.Minute()), 10)
553         b = append(b, vi.timeSeparator...)
554
555         if t.Second() < 10 {
556                 b = append(b, '0')
557         }
558
559         b = strconv.AppendInt(b, int64(t.Second()), 10)
560         b = append(b, []byte{0x20}...)
561
562         tz, _ := t.Zone()
563         b = append(b, tz...)
564
565         return string(b)
566 }
567
568 // FmtTimeFull returns the full time representation of 't' for 'vi_VN'
569 func (vi *vi_VN) FmtTimeFull(t time.Time) string {
570
571         b := make([]byte, 0, 32)
572
573         if t.Hour() < 10 {
574                 b = append(b, '0')
575         }
576
577         b = strconv.AppendInt(b, int64(t.Hour()), 10)
578         b = append(b, vi.timeSeparator...)
579
580         if t.Minute() < 10 {
581                 b = append(b, '0')
582         }
583
584         b = strconv.AppendInt(b, int64(t.Minute()), 10)
585         b = append(b, vi.timeSeparator...)
586
587         if t.Second() < 10 {
588                 b = append(b, '0')
589         }
590
591         b = strconv.AppendInt(b, int64(t.Second()), 10)
592         b = append(b, []byte{0x20}...)
593
594         tz, _ := t.Zone()
595
596         if btz, ok := vi.timezones[tz]; ok {
597                 b = append(b, btz...)
598         } else {
599                 b = append(b, tz...)
600         }
601
602         return string(b)
603 }