Documentation
¶
Index ¶
- Constants
- Variables
- func Edit(key, value string, action Action) (bool, error)
- func IsSupported(lang string) bool
- func LangPack(lang string) map[Key]string
- func SearchVar(content string) (map[string]string, error)
- func SupportedLanguages() []string
- func TAll(key Key) []string
- type Action
- type Translator
Constants ¶
View Source
const DefaultLanguage = "en"
View Source
const LocalePath = "locales"
Variables ¶
View Source
var RegexPlaceholder = regexp.MustCompile(`\{\{\.(\w+)}}`)
Functions ¶
func IsSupported ¶
func SupportedLanguages ¶
func SupportedLanguages() []string
Types ¶
type Translator ¶
type Translator struct {
// contains filtered or unexported fields
}
func New ¶
func New(language string) *Translator
func (*Translator) T ¶
func (t *Translator) T(key Key) string
Click to show internal directories.
Click to hide internal directories.