Documentation
¶
Index ¶
Constants ¶
View Source
const AcceptLanguage = "Accept-Language"
AcceptLanguage is the Header key "Accept-Language"
Variables ¶
This section is empty.
Functions ¶
func I18n ¶
func I18n(_options ...Options) iris.HandlerFunc
I18n returns the middleware as iris.HandlerFunc with the passed options
func I18nHandler ¶
func I18nHandler(_options ...Options) *i18nMiddleware
I18nHandler returns the middleware which is just an iris.handler
Types ¶
type Options ¶
type Options struct {
// Default set it if you want a default language
//
// Checked: Configuration state, not at runtime
Default string
// URLParameter is the name of the url parameter which the language can be indentified
//
// Checked: Serving state, runtime
URLParameter string
// Languages is a map[string]string which the key is the language i81n and the value is the file location
//
// Example of key is: 'en-US'
// Example of value is: './locales/en-US.ini'
Languages map[string]string
}
Options the i18n options
Click to show internal directories.
Click to hide internal directories.