Skip to content

Commit

Permalink
feat: sorted languages alphabetically
Browse files Browse the repository at this point in the history
  • Loading branch information
saurabhsircar11 committed Dec 16, 2024
1 parent a38e8ed commit a4314b9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion libs/blocks/locui-create/input-locale/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,8 @@ export default function useInputLocale() {

const handleNext = async () => {
if (!errorPresent()) return;
const sortedLanguages = transformActiveLocales().sort((a, b) => a.language - b.language);
const sortedLanguages = transformActiveLocales()
.sort((a, b) => a.language.localeCompare(b.language));
setProject({ languages: prefillActionAndWorkflow(sortedLanguages) });
setLocale({ selectedRegion, selectedLocale, activeLocales });

Expand Down
2 changes: 1 addition & 1 deletion libs/blocks/locui-create/utils/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export function processLocaleData(localeData) {
.split(',')
.map((loc) => loc.trim())
.join(','),
}));
})).sort((a, b) => a.language.localeCompare(b.language));

const processedLocaleRegion = localeData.localegroups.data.map((item) => ({
...item,
Expand Down

0 comments on commit a4314b9

Please sign in to comment.