Skip to content

Commit

Permalink
Sort i18n language list on the settings UI
Browse files Browse the repository at this point in the history
  • Loading branch information
knadh committed Apr 21, 2021
1 parent 1c8d272 commit 5868db0
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cmd/i18n.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"encoding/json"
"fmt"
"net/http"
"sort"

"github.com/knadh/listmonk/internal/i18n"
"github.com/knadh/stuffbin"
Expand Down Expand Up @@ -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
}

Expand Down

0 comments on commit 5868db0

Please sign in to comment.