Skip to content

Commit

Permalink
Sort languages in the language selector by the language code
Browse files Browse the repository at this point in the history
  • Loading branch information
lslezak committed Oct 31, 2023
1 parent 655e957 commit 74ecdd9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions web/src/components/l10n/LanguageSwitcher.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ export default function LanguageSwitcher() {
changeLanguage(value);
}, [setSelected, changeLanguage]);

const options = Object.entries(languages).map(([id, name]) => {
return <FormSelectOption key={id} value={id} label={name} />;
});
// sort by the language code to maintain consistent order
const options = Object.keys(languages).sort()
.map(id => <FormSelectOption key={id} value={id} label={languages[id]} />);

return (
<>
Expand Down

0 comments on commit 74ecdd9

Please sign in to comment.