Restructure language loading to support incomplete translations

On startup, files are scanned and any missing values are replaced with
the english version.
This commit is contained in:
Harvey Tindall
2021-01-19 00:29:29 +00:00
parent 1aadd12006
commit e834445b0b
7 changed files with 398 additions and 177 deletions
+1 -2
View File
@@ -569,7 +569,6 @@ func start(asDaemon, firstCall bool) {
router.Use(gin.Recovery())
router.Use(static.Serve("/", static.LocalFile(filepath.Join(app.localPath, "web"), false)))
router.Use(static.Serve("/lang/", static.LocalFile(filepath.Join(app.localPath, "lang"), false)))
app.loadHTML(router)
router.NoRoute(app.NoRouteHandler)
if debugMode {
@@ -580,7 +579,7 @@ func start(asDaemon, firstCall bool) {
router.GET("/", app.AdminPage)
router.GET("/accounts", app.AdminPage)
router.GET("/settings", app.AdminPage)
router.GET("/lang/:page/:file", app.ServeLang)
router.GET("/lang/:page", app.GetLanguages)
router.GET("/token/login", app.getTokenLogin)
router.GET("/token/refresh", app.getTokenRefresh)