Documentation
¶
Index ¶
- Variables
- func BuildMetazoneMap(cldrData *cldr.CLDR) map[string]string
- func BuildParentLocaleMap(cldrData *cldr.CLDR) map[string]string
- func Generate(dataPath string) iter.Seq2[string, LocaleConfig]
- type CurrencyConfig
- type DateTimeConfig
- type Days
- type LocaleConfig
- type Months
- type MonthsConfig
- type NumberConfig
- type TimeZoneNames
- type WeekDaysConfig
Constants ¶
This section is empty.
Variables ¶
View Source
var (
TestMode = false
)
Functions ¶
func BuildMetazoneMap ¶
BuildMetazoneMap builds a map of IANA timezone name → metazone name from the CLDR supplemental metazoneInfo data. Only the current (no "to" date) mapping is used.
func BuildParentLocaleMap ¶
BuildParentLocaleMap builds a map of locale -> parent from the CLDR supplemental parentLocales data, falling back to the default algorithm (strip rightmost component, then "root").
Types ¶
type CurrencyConfig ¶
type CurrencyConfig struct {
// StandardPattern is the CLDR standard currency format pattern (e.g. "#,##0.00 ¤").
StandardPattern string
// AccountingPattern is the CLDR accounting format pattern (e.g. "¤ #,##0.00;(¤ #,##0.00)").
AccountingPattern string
// CurrencySymbols maps currency code (e.g. "NOK") to its locale symbol (e.g. "kr").
CurrencySymbols map[string]string
}
CurrencyConfig holds locale-specific currency formatting data.
type DateTimeConfig ¶
type LocaleConfig ¶
type LocaleConfig struct {
MonthsConfig
WeekDaysConfig
NumberConfig
CurrencyConfig
DateTimeConfig
TZNames TimeZoneNames
}
func ResolveLocale ¶
ResolveLocale builds a fully inherited localeConfig by walking up the parent chain (e.g. nn -> no -> root) and merging.
func (LocaleConfig) String ¶
func (d LocaleConfig) String() string
type MonthsConfig ¶
type NumberConfig ¶
type TimeZoneNames ¶
TimeZoneNames maps metazone name → [standard, daylight] long names.
Click to show internal directories.
Click to hide internal directories.