mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 04:14:39 +03:00
Custom localization (#2837)
Co-authored-by: WithoutPants <53250216+WithoutPants@users.noreply.github.com>
This commit is contained in:
@@ -179,6 +179,21 @@ func Start() error {
|
||||
|
||||
http.ServeFile(w, r, fn)
|
||||
})
|
||||
r.HandleFunc("/customlocales", func(w http.ResponseWriter, r *http.Request) {
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
if !c.GetCustomLocalesEnabled() {
|
||||
return
|
||||
}
|
||||
|
||||
// search for custom-locales.json in current directory, then $HOME/.stash
|
||||
fn := c.GetCustomLocalesPath()
|
||||
exists, _ := fsutil.FileExists(fn)
|
||||
if !exists {
|
||||
return
|
||||
}
|
||||
|
||||
http.ServeFile(w, r, fn)
|
||||
})
|
||||
|
||||
r.HandleFunc("/login*", func(w http.ResponseWriter, r *http.Request) {
|
||||
ext := path.Ext(r.URL.Path)
|
||||
|
||||
Reference in New Issue
Block a user