Sort i18n language list on the settings UI
This commit is contained in:
parent
1c8d2725c6
commit
5868db0124
|
@ -4,6 +4,7 @@ import (
|
|||
"encoding/json"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"sort"
|
||||
|
||||
"github.com/knadh/listmonk/internal/i18n"
|
||||
"github.com/knadh/stuffbin"
|
||||
|
@ -62,6 +63,10 @@ func getI18nLangList(lang string, app *App) ([]i18nLang, error) {
|
|||
})
|
||||
}
|
||||
|
||||
sort.SliceStable(out, func(i, j int) bool {
|
||||
return out[i].Code < out[j].Code
|
||||
})
|
||||
|
||||
return out, nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue