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:
@@ -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);
|
||||
}
|
||||
|
||||
// 如果只有一个没有时间戳,没有时间戳的排在前面
|
||||
|
||||
Reference in New Issue
Block a user