initial steps for localisation

This commit is contained in:
Harvey Tindall
2020-10-30 22:51:47 +00:00
parent 95c9f4f42d
commit d64d5c194f
8 changed files with 104 additions and 40 deletions
+6
View File
@@ -263,6 +263,12 @@ func start(asDaemon, firstCall bool) {
if app.loadConfig() != nil {
app.err.Fatalf("Failed to load config file \"%s\"", app.config_path)
}
lang := app.config.Section("ui").Key("language").MustString("en-us")
app.storage.lang.FormPath = filepath.Join(app.local_path, "lang", "form", lang+".json")
if _, err := os.Stat(app.storage.lang.FormPath); os.IsNotExist(err) {
app.storage.lang.FormPath = filepath.Join(app.local_path, "lang", "form", "en-us.json")
}
app.storage.loadLang()
app.version = app.config.Section("jellyfin").Key("version").String()
// read from config...
debugMode = app.config.Section("ui").Key("debug").MustBool(false)