Documentation
¶
Overview ¶
Package i18n shares MyGo's message catalogs with the native UI and pages.
Index ¶
- func FormatDate(t, now time.Time) string
- func FormatDateIn(t, now time.Time, lang string) string
- func FullDate(t time.Time) string
- func FullDateIn(t time.Time, lang string) string
- func Keys() []string
- func Language() string
- func Plural(key string, n int) string
- func SetLanguage(tag string)
- func T(key string) string
- func Tf(key string, args ...any) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatDate ¶ added in v1.17.0
FormatDate is FormatDateIn in the locale SetLanguage was given, which keeps the region the catalog match drops (en-GB is "en" for T, day-first here).
func FormatDateIn ¶ added in v1.17.0
FormatDateIn is t's numeric date in lang (CLDR short date, Md / yMd), in now's zone, without the year in now's year: "01.10." / "01.10.2025" (de).
func FullDateIn ¶ added in v1.17.0
FullDateIn is t's numeric date with the year in lang, in t's own zone.
func SetLanguage ¶
func SetLanguage(tag string)
SetLanguage selects the catalog language best matching tag (or "en") and accepts MyGo's pseudo locales for layout checks.
Types ¶
This section is empty.