Skip to content

High performance, self-hosted, newsletter and mailing list manager with a modern dashboard. Single binary app.

Sort i18n language list on the settings UI

Kailash Nadh5868db012469
diff --git a/cmd/i18n.go b/cmd/i18n.go
index 3b429cef..fc963d1b 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
}