forked from Mirrors/elk
feat: prefer en language as top (#2042)
This commit is contained in:
parent
98777f078c
commit
076c47b7b0
1 changed files with 4 additions and 0 deletions
|
@ -20,6 +20,10 @@ const languages = $computed(() =>
|
||||||
? fuse.search(languageKeyword).map(r => r.item)
|
? fuse.search(languageKeyword).map(r => r.item)
|
||||||
: [...languagesNameList].filter(entry => !userSettings.value.disabledTranslationLanguages.includes(entry.code))
|
: [...languagesNameList].filter(entry => !userSettings.value.disabledTranslationLanguages.includes(entry.code))
|
||||||
.sort(({ code: a }, { code: b }) => {
|
.sort(({ code: a }, { code: b }) => {
|
||||||
|
// Put English on the top
|
||||||
|
if (a === 'en')
|
||||||
|
return -1
|
||||||
|
|
||||||
return a === modelValue ? -1 : b === modelValue ? 1 : a.localeCompare(b)
|
return a === modelValue ? -1 : b === modelValue ? 1 : a.localeCompare(b)
|
||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue