Added frontend localization

This commit is contained in:
2026-04-05 22:46:52 +03:00
parent 4902889401
commit 6872563c62
14 changed files with 675 additions and 170 deletions
+11 -2
View File
@@ -45,7 +45,7 @@ func NewServer(cfg config.Config) *Server {
}
swaggerHandler := ginSwagger.WrapHandler(swaggerFiles.Handler)
router.GET(openAPIEndpoint, func(c *gin.Context) {
serveSwaggerIndex := func(c *gin.Context) {
recorder := httptest.NewRecorder()
proxyCtx, _ := gin.CreateTestContext(recorder)
proxyCtx.Request = c.Request.Clone(c.Request.Context())
@@ -69,8 +69,17 @@ func NewServer(cfg config.Config) *Server {
c.Status(recorder.Code)
_, _ = c.Writer.WriteString(body)
}
router.GET(openAPIEndpoint, serveSwaggerIndex)
router.GET(openAPIEndpoint+"/*any", func(c *gin.Context) {
if c.Param("any") == "/" {
serveSwaggerIndex(c)
return
}
swaggerHandler(c)
})
router.GET(openAPIEndpoint+"/*any", swaggerHandler)
}
apiV1 := router.Group("/api/v1")