Skip to content

Commit

Permalink
Merge pull request #833 from openSUSE/sort_languages
Browse files Browse the repository at this point in the history
Sort languages in the language selector by the language code
  • Loading branch information
lslezak authored Oct 31, 2023
2 parents 655e957 + 74ecdd9 commit 93876aa
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 93876aa

Please sign in to comment.