...

Source file src/github.com/go-playground/locales/de_AT/de_AT.go

Documentation: github.com/go-playground/locales/de_AT

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

View as plain text