mirror of
https://github.com/hrfee/jfa-go.git
synced 2026-01-18 16:47:42 +01:00
Merge branch 'new-setup'
Merge new setup wizard This is much more up-to-date than the previous setup page, with a new design and previously missing/new settings. Currently only available in english (hopefully that changes soon). also fixes conflict in _post.
This commit is contained in:
40
lang.go
40
lang.go
@@ -26,6 +26,13 @@ func (ls *adminLangs) getOptions(chosen string) (string, []string) {
|
||||
return chosenLang, opts
|
||||
}
|
||||
|
||||
type commonLangs map[string]commonLang
|
||||
|
||||
type commonLang struct {
|
||||
Meta langMeta `json:"meta"`
|
||||
Strings langSection `json:"strings"`
|
||||
}
|
||||
|
||||
type adminLang struct {
|
||||
Meta langMeta `json:"meta"`
|
||||
Strings langSection `json:"strings"`
|
||||
@@ -79,6 +86,39 @@ type emailLang struct {
|
||||
WelcomeEmail langSection `json:"welcomeEmail"`
|
||||
}
|
||||
|
||||
type setupLangs map[string]setupLang
|
||||
|
||||
type setupLang struct {
|
||||
Meta langMeta `json:"meta"`
|
||||
Strings langSection `json:"strings"`
|
||||
StartPage langSection `json:"startPage"`
|
||||
EndPage langSection `json:"endPage"`
|
||||
General langSection `json:"general"`
|
||||
Language langSection `json:"language"`
|
||||
Login langSection `json:"login"`
|
||||
JellyfinEmby langSection `json:"jellyfinEmby"`
|
||||
Ombi langSection `json:"ombi"`
|
||||
Email langSection `json:"email"`
|
||||
Notifications langSection `json:"notifications"`
|
||||
WelcomeEmails langSection `json:"welcomeEmails"`
|
||||
PasswordResets langSection `json:"passwordResets"`
|
||||
InviteEmails langSection `json:"inviteEmails"`
|
||||
PasswordValidation langSection `json:"passwordValidation"`
|
||||
HelpMessages langSection `json:"helpMessages"`
|
||||
JSON string
|
||||
}
|
||||
|
||||
func (ls *setupLangs) getOptions(chosen string) (string, []string) {
|
||||
opts := make([]string, len(*ls))
|
||||
chosenLang := (*ls)[chosen].Meta.Name
|
||||
i := 0
|
||||
for _, lang := range *ls {
|
||||
opts[i] = lang.Meta.Name
|
||||
i++
|
||||
}
|
||||
return chosenLang, opts
|
||||
}
|
||||
|
||||
type langSection map[string]string
|
||||
|
||||
func (el langSection) format(field string, vals ...string) string {
|
||||
|
||||
Reference in New Issue
Block a user