mirror of
https://github.com/cheeaun/phanpy.git
synced 2025-01-23 00:56:23 +01:00
Should use localeCompare
This commit is contained in:
parent
0f41d46c52
commit
480e1aa733
1 changed files with 2 additions and 2 deletions
|
@ -44,8 +44,8 @@ export default function LangSelector() {
|
||||||
if (a.code === 'pseudo-LOCALE') return 1;
|
if (a.code === 'pseudo-LOCALE') return 1;
|
||||||
if (b.code === 'pseudo-LOCALE') return -1;
|
if (b.code === 'pseudo-LOCALE') return -1;
|
||||||
// Sort by common name
|
// Sort by common name
|
||||||
if (a._common < b._common) return -1;
|
const order = a._common.localeCompare(b._common, i18n.locale);
|
||||||
if (a._common > b._common) return 1;
|
if (order !== 0) return order;
|
||||||
// Sort by code (fallback)
|
// Sort by code (fallback)
|
||||||
if (a.code < b.code) return -1;
|
if (a.code < b.code) return -1;
|
||||||
if (a.code > b.code) return 1;
|
if (a.code > b.code) return 1;
|
||||||
|
|
Loading…
Reference in a new issue