i18n

package
v0.0.0-...-0eaed87 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init() *i18n.Localizer

Init ...

Types

type I18n

type I18n struct {
	LanguageCode string
	Accept       string
	Loc          *i18n.Localizer
}

I18n ...

func NewHandler

func NewHandler() *I18n

NewHandler ...

func (*I18n) ChangeLanguage

func (i *I18n) ChangeLanguage(lang string, accept string)

ChangeLanguage ... @summary if lang "" than take accept @summary lang = request.languageCode @sumarry accept = Header("Accept-Language") @params lang string @params accept string

func (*I18n) GetTranslation

func (i *I18n) GetTranslation(messageKey string) string

GetTranslation ge translation from i18n json @params messageKey string @params messageData map[string]interface{} @return string

func (*I18n) GetTranslationWithData

func (i *I18n) GetTranslationWithData(messageKey string, messageData map[string]interface{}, lang string) string

GetTranslationWithData ge translation from i18n json @params messageKey string @params messageData map[string]interface{} @params lang string = "" for default @return string

Jump to

Keyboard shortcuts

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