feat: 确保国家选项按照各个语言的顺序 而不是Unicode

This commit is contained in:
Wyatt Bai
2025-04-02 20:52:29 +10:30
parent 52948488d5
commit 4750964f75

View File

@@ -1280,7 +1280,7 @@ const SalaryCalculator = () => {
// 确保中国始终排在第一位
if (a === 'CN') return -1;
if (b === 'CN') return 1;
return getCountryName(a).localeCompare(getCountryName(b));
return new Intl.Collator(['zh', 'ja', 'en']).compare(getCountryName(a), getCountryName(b));
}).map(code => (
<option key={code} value={code}>
{getCountryName(code)} ({pppFactors[code].toFixed(2)})