update I18n function for controller

This commit is contained in:
Hamidreza Ghavami
2023-05-21 06:40:40 +04:30
parent dd363d2ead
commit 43dc1e5522
2 changed files with 16 additions and 11 deletions

View File

@@ -185,10 +185,10 @@ func (s *Server) initRouter() (*gin.Engine, error) {
}
// Apply locale middleware for i18n
webI18nFunc := func(key string, params ...string) string {
i18nWebFunc := func(key string, params ...string) string {
return locale.I18n(locale.Web, key, params...)
}
engine.FuncMap["i18n"] = webI18nFunc
engine.FuncMap["i18n"] = i18nWebFunc
engine.Use(locale.LocalizerMiddleware())
// set static files and template