Documentation
¶
Index ¶
- func AddContext(c echo.Context) gobwebs.Map
- func GetDefaultLang() string
- func GetGlobalLocalizer(lang string) *localizer.Localizer
- func GetLang(c echo.Context) string
- func GetLocalizer(lang string) (*localizer.Localizer, bool)
- func GetSessionGlobalLocalizer(c echo.Context) *localizer.Localizer
- func GetSessionLocalizer(c echo.Context) *localizer.Localizer
- func LoadMessages(c echo.Context) gobwebs.Map
- func SetLang(c echo.Context, lang string) error
- func StripHtmlTags(blob string) string
- type PageData
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddContext ¶
AddContext will add the echo.Context into the template namespace
func GetDefaultLang ¶
func GetDefaultLang() string
GetDefaultLang returns the server set DefaultLang
func GetGlobalLocalizer ¶
GetGlobalLocalizer fetches a Localizer for given language using the default global language catalog
func GetLocalizer ¶
GetLocalizer fetches a Localizer for given language using the Gatalog (gobwebs specific) language catalog
func GetSessionGlobalLocalizer ¶
GetSessionGlobalLocalizer fetches Localizer for language stored in user session. If no language is set, or found, it defaults to English (en). This will return a Localizer using the message.DefaultCatalog catalog.
func GetSessionLocalizer ¶
GetSessionLocalizer fetches Localizer for language stored in user session. If no language is set, or found, it defaults to English (en). This will return a Localizer using the Gatalog gobwebs catalog
func LoadMessages ¶
LoadMessages loads all session flash messages into template data context under the variable name `messages`
func SetLang ¶
SetLang sets language in the users session
func StripHtmlTags ¶
StripHtmlTags helper function strip all <> tags from a string. For more features/control use something like the bluemonday module. Adapted from the following SO answer: https://stackoverflow.com/a/64701836