i18n

package
v0.19.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 14, 2021 License: AGPL-3.0 Imports: 9 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetLocale

func GetLocale(ctx context.Context) string

GetLocale returns the locale defined in context If it is not defined, the environment locale is used

func IsValidLocale

func IsValidLocale(locale string) bool

IsValidLocale returns true if given locale is valid

func T

func T(ctx context.Context, key string, params ...Params) string

T translates a given key to current locale Params is used to replace variables and pluralize

Types

type Params

type Params map[string]interface{}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL