feat: Add categorized provider list with clear API key requirements

- Added visual separators to distinguish between free and API key required services
- Free Services: Microsoft Translator, Google Translate, LibreTranslate, MyMemory
- Require API Key: GLM-4 Flash, Silicon Flow, Baidu, Youdao, DeepL, Azure
- Added separator validation to prevent selection of category headers
- Improved user experience with clear service categorization
- Enhanced provider selection clarity for better decision making
This commit is contained in:
Cyber Dick Lang
2025-10-27 18:10:47 +08:00
parent 4e6f6172ac
commit 8653eddf56
+8
View File
@@ -736,10 +736,12 @@ class TextTranslator_UTK:
# Provider list with free/paid indicators (ordered by priority)
provider_list = [
"auto",
"--- Free Services ---",
"Microsoft Translator (Free)",
"Google Translate (Free)",
"LibreTranslate (Free)",
"MyMemory (Free)",
"--- Require API Key ---",
"GLM-4 Flash (Free)",
"Silicon Flow (Free)",
"Baidu Translate (Free)",
@@ -839,6 +841,12 @@ class TextTranslator_UTK:
else:
# Use specific provider
print(f"🎯 Using specific provider: {provider}")
# Skip separator items
if provider.startswith("---"):
print(f"❌ Error: '{provider}' is a separator, not a provider")
return ("", "", f"Error: '{provider}' is a separator, not a provider")
if provider not in self.providers:
print(f"❌ Error: Unknown provider '{provider}'")
return ("", "", f"Error: Unknown provider '{provider}'")