From 412edc1ba40cf9ae73bf39cd983702d57fef5129 Mon Sep 17 00:00:00 2001 From: LinkinStar Date: Wed, 2 Nov 2022 16:35:41 +0800 Subject: [PATCH] fix: move i18n dir --- internal/router/ui.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/router/ui.go b/internal/router/ui.go index 4d465716..6589d5b1 100644 --- a/internal/router/ui.go +++ b/internal/router/ui.go @@ -41,6 +41,7 @@ func (r *_resource) Open(name string) (fs.File, error) { // Register a new static resource which generated by ui directory func (a *UIRouter) Register(r *gin.Engine) { staticPath := os.Getenv("ANSWER_STATIC_PATH") + r.StaticFS("/i18n/", http.FS(i18n.I18n)) // if ANSWER_STATIC_PATH is set and not empty, ignore embed resource if staticPath != "" { @@ -53,7 +54,6 @@ func (a *UIRouter) Register(r *gin.Engine) { r.LoadHTMLGlob(staticPath + "/*.html") r.Static("/static", staticPath+"/static") - r.StaticFS("/i18n/", http.FS(i18n.I18n)) r.NoRoute(func(c *gin.Context) { c.HTML(http.StatusOK, "index.html", gin.H{}) })