i18n: localize provider preset names and sorting logic

- Replace hardcoded Chinese preset names with English versions (Claude Official, Zhipu GLM, Qwen Coder, ModelScope, Codex Official, KAT-Coder)
- Update ProviderList sorting to use locale-aware comparison based on current language (zh-CN for Chinese, en-US for English)
- Reorder presets: move KAT-Coder before PackyCode for better grouping
This commit is contained in:
Jason
2025-10-08 11:02:09 +08:00
parent 01da9a1eac
commit 3f3905fda0
3 changed files with 31 additions and 29 deletions

View File

@@ -29,7 +29,7 @@ const ProviderList: React.FC<ProviderListProps> = ({
appType,
onNotify,
}) => {
const { t } = useTranslation();
const { t, i18n } = useTranslation();
// 提取API地址兼容不同供应商配置Claude env / Codex TOML
const getApiUrl = (provider: Provider): string => {
try {
@@ -118,7 +118,8 @@ const ProviderList: React.FC<ProviderListProps> = ({
// 如果都没有时间戳,按名称排序
if (timeA === 0 && timeB === 0) {
return a.name.localeCompare(b.name, "zh-CN");
const locale = i18n.language === "zh" ? "zh-CN" : "en-US";
return a.name.localeCompare(b.name, locale);
}
// 如果只有一个没有时间戳,没有时间戳的排在前面