✨ add i18n support
This commit is contained in:
@@ -1,7 +1,16 @@
|
||||
package middleware
|
||||
|
||||
import "net/http"
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
func I18nMiddleware(w http.ResponseWriter, r *http.Request) {
|
||||
"golang.org/x/text/language"
|
||||
|
||||
"schisandra-album-cloud-microservices/common/i18n"
|
||||
)
|
||||
|
||||
func I18nMiddleware(next http.HandlerFunc) http.HandlerFunc {
|
||||
return i18n.NewI18nMiddleware([]language.Tag{
|
||||
language.English,
|
||||
language.Chinese,
|
||||
}, []string{"../../resources/language/active.en.toml", "../../resources/language/active.zh.toml"}).Handle(next)
|
||||
}
|
||||
|
Reference in New Issue
Block a user