func en() { p := simple.New().AddLanguage("en", "English", map[string]string{ TimeFormatRoot + ":" + DateFormat + ":" + OptionDefault: "Jan 02, 2006", }) ginta.Register(p) internal.Activate("en") }
func de() { p := simple.New().AddLanguage("de", "Deutsch", map[string]string{ TimeFormatRoot + ":" + DateTimeFormat + ":" + OptionLong: "Monday, 02. January 2006, um 15:04", SubstitutionsResourceBundle + ":Wednesday": "Mittwoch", SubstitutionsResourceBundle + ":May": "Mai", }) ginta.Register(p) internal.Activate("de") }
/* Returns a resource by simple name matching */ func (l Locale) GetResource(key string) (string, error) { locale := string(l) internal.Activate(locale) return internal.Request(locale, key, false) }
/* Resolves a resource by its hierarchical key. */ func (l Locale) ResolveResource(k types.HierarchicalKey) (string, error) { locale := string(l) internal.Activate(locale) return internal.Request(locale, string(k), true) }
/* Returns the combination of this resource bundle and all its parent bundles. The resources defined in a child are not overwritten by its parent. */ func (l Locale) ResolveResourceBundle(prefix string) map[string]string { locale := string(l) internal.Activate(locale) return internal.RequestBundle(locale, prefix, true) }