mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2025-03-01 01:20:49 +03:00
add localizer middleware to web.go
This commit is contained in:
parent
92eaff9608
commit
4865754b3d
@ -207,6 +207,13 @@ func (s *Server) initRouter() (*gin.Engine, error) {
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Apply locale middleware for i18n
|
||||||
|
webI18nFunc := func(key string, params ...string) string {
|
||||||
|
return locale.I18n(locale.Web, key, params...)
|
||||||
|
}
|
||||||
|
engine.FuncMap["i18n"] = webI18nFunc
|
||||||
|
engine.Use(locale.LocalizerMiddleware())
|
||||||
|
|
||||||
// set static files and template
|
// set static files and template
|
||||||
if config.IsDebug() {
|
if config.IsDebug() {
|
||||||
// for development
|
// for development
|
||||||
|
Loading…
Reference in New Issue
Block a user