From 5868db01246955520d152b3369f8a78bf5703f5f Mon Sep 17 00:00:00 2001 From: Kailash Nadh Date: Wed, 21 Apr 2021 19:04:04 +0530 Subject: [PATCH] Sort i18n language list on the settings UI --- cmd/i18n.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cmd/i18n.go b/cmd/i18n.go index 3b429ce..fc963d1 100644 --- a/cmd/i18n.go +++ b/cmd/i18n.go @@ -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 }