mirror of https://gitee.com/answerdev/answer.git
Merge branch 'feat/language' into 'test'
fix: move i18n dir See merge request opensource/answer!164
This commit is contained in:
commit
de6c61a678
|
@ -41,6 +41,7 @@ func (r *_resource) Open(name string) (fs.File, error) {
|
||||||
// Register a new static resource which generated by ui directory
|
// Register a new static resource which generated by ui directory
|
||||||
func (a *UIRouter) Register(r *gin.Engine) {
|
func (a *UIRouter) Register(r *gin.Engine) {
|
||||||
staticPath := os.Getenv("ANSWER_STATIC_PATH")
|
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 ANSWER_STATIC_PATH is set and not empty, ignore embed resource
|
||||||
if staticPath != "" {
|
if staticPath != "" {
|
||||||
|
@ -53,7 +54,6 @@ func (a *UIRouter) Register(r *gin.Engine) {
|
||||||
|
|
||||||
r.LoadHTMLGlob(staticPath + "/*.html")
|
r.LoadHTMLGlob(staticPath + "/*.html")
|
||||||
r.Static("/static", staticPath+"/static")
|
r.Static("/static", staticPath+"/static")
|
||||||
r.StaticFS("/i18n/", http.FS(i18n.I18n))
|
|
||||||
r.NoRoute(func(c *gin.Context) {
|
r.NoRoute(func(c *gin.Context) {
|
||||||
c.HTML(http.StatusOK, "index.html", gin.H{})
|
c.HTML(http.StatusOK, "index.html", gin.H{})
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue