Sort i18n language list on the settings UI

This commit is contained in:
Kailash Nadh 2021-04-21 19:04:04 +05:30
parent 1c8d2725c6
commit 5868db0124

View file

@ -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
}