mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2025-04-19 21:42:24 +00:00
add localizer middleware to web.go
This commit is contained in:
parent
92eaff9608
commit
4865754b3d
1 changed files with 7 additions and 0 deletions
|
@ -207,6 +207,13 @@ func (s *Server) initRouter() (*gin.Engine, error) {
|
|||
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
|
||||
if config.IsDebug() {
|
||||
// for development
|
||||
|
|
Loading…
Reference in a new issue