Documentation
¶
Overview ¶
Package i18n handles internationalization and the like for Go programs.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type L ¶
type L struct {
// contains filtered or unexported fields
}
L represents Lingo bundle, containing map of all Ts by locale, as well as default locale and list of supported locales
func New ¶
New creates the Lingo bundle. Params: Default locale, to be used when requested locale is not found. Path, absolute or relative path to a folder where translation .json files are kept
func (*L) TranslationsForLocale ¶
TranslationsForLocale will get the T for specific locale. If no locale is found, returns default T
type Locale ¶
Locale is locale value from the Accept-Language header in request
func GetLocales ¶
GetLocales returns supported locales for the given requet
func GetPreferredLocale ¶
GetPreferredLocale return preferred locale for the given reuqest returns error if there is no preferred locale
func ParseLocale ¶
ParseLocale creates a Locale from a locale string