MCPcopy
hub / github.com/TecharoHQ/anubis / GetLang

Method GetLang

lib/localization/localization.go:119–125  ·  view source on GitHub ↗

Get the language that is used by the localizer by retrieving a well-known string that is required to be present

()

Source from the content-addressed store, hash-verified

117
118// Get the language that is used by the localizer by retrieving a well-known string that is required to be present
119func (sl *SimpleLocalizer) GetLang() string {
120 _, tag, err := sl.Localizer.LocalizeWithTag(&i18n.LocalizeConfig{MessageID: "loading"})
121 if err != nil {
122 return "en"
123 }
124 return tag.String()
125}
126
127// GetLocalizer creates a localizer based on the request's Accept-Language header or forcedLanguage option
128func GetLocalizer(r *http.Request) *SimpleLocalizer {

Callers 3

baseFunction · 0.80

Calls 1

StringMethod · 0.45

Tested by 2