We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6b79ab0 commit c4d89c7Copy full SHA for c4d89c7
scripts/shared.ts
@@ -123,7 +123,14 @@ export async function getOperators() {
123
}),
124
(el) => el.name,
125
).sort((a, b) => {
126
- return pinyin.compare(a.name, b.name) || a.id.localeCompare(b.id, 'zh')
+ // 默认的 pinyin.compare() 没有传入 locale 参数,导致在不同的系统上有不同的排序结果,
127
+ // 所以这里手动实现一下,并带上 locale
128
+ // https://github.com/MaaAssistantArknights/maa-copilot-frontend/pull/265
129
+ const pinyinA = String(pinyin(a.name))
130
+ const pinyinB = String(pinyin(b.name))
131
+ return (
132
+ pinyinA.localeCompare(pinyinB, 'zh') || a.id.localeCompare(b.id, 'en')
133
+ )
134
})
135
return {
136
professions,
0 commit comments