Skip to content

Commit

Permalink
Fixed sort() call in listAvailableLanguageInformation.
Browse files Browse the repository at this point in the history
Refs #40
  • Loading branch information
reinhardt authored and gforcada committed Nov 30, 2022
1 parent 0dc73e9 commit 973cf1a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
1 change: 1 addition & 0 deletions news/40.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixed error in listAvailableLanguageInformation
5 changes: 1 addition & 4 deletions plone/i18n/utility.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,7 @@ def listAvailableLanguageInformation(self):
# flatten outer dict to list to make it sortable
new_langs.append(langs[lang])
new_langs.sort(
lambda x, y: cmp(
x.get("native", x.get("name")),
y.get("native", y.get("name")),
)
key=lambda x: x.get("native", x.get("name")),
)
return new_langs

Expand Down

0 comments on commit 973cf1a

Please sign in to comment.