mirror of
https://github.com/navidrome/navidrome.git
synced 2025-04-04 04:57:37 +03:00
Fix loading overridden translations from ${DataFolder}/resources/i18n
This commit is contained in:
parent
50ff8bcce7
commit
028723f721
5 changed files with 17 additions and 21 deletions
|
@ -14,20 +14,19 @@ import (
|
|||
var (
|
||||
//go:embed *
|
||||
fsys embed.FS
|
||||
FS fs.FS
|
||||
)
|
||||
|
||||
func FS() fs.FS {
|
||||
return utils.MergeFS{
|
||||
Base: fsys,
|
||||
Overlay: os.DirFS(path.Join(conf.Server.DataFolder, "resources")),
|
||||
}
|
||||
}
|
||||
|
||||
func Asset(path string) ([]byte, error) {
|
||||
f, err := FS.Open(path)
|
||||
f, err := FS().Open(path)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return io.ReadAll(f)
|
||||
}
|
||||
|
||||
func init() {
|
||||
FS = utils.MergeFS{
|
||||
Base: fsys,
|
||||
Overlay: os.DirFS(path.Join(conf.Server.DataFolder, "resources")),
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue