Use fs for language, add lang_files option

The local app translations are loaded, and then if [files]/lang_files
is provided (a directory containing custom translations), any found
inside it are loaded over top. This makes customizing much easier.
This commit is contained in:
Harvey Tindall
2021-02-01 17:39:19 +00:00
parent fefe2d82a4
commit 0330540f87
7 changed files with 207 additions and 83 deletions

View File

@@ -6,8 +6,10 @@ import (
"strings"
)
// Since the gin-static middleware uses a version of http.Filesystem with an extra Exists() func, we extend it here.
type httpFS struct {
hfs http.FileSystem
hfs http.FileSystem // Created by converting fs.FS using http.FS()
fs fs.FS
}