osc/deploy/baidu-translate/settings.py
2026-01-19 11:14:41 +08:00

27 lines
468 B
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# settings.py
# 百度翻译 API 配置
BAIDU_APP_ID = "20200811000539778"
BAIDU_SECRET_KEY = "uK9IyUhuEWX3PIqN75iC"
TIMEOUT = 10
MAX_TEXT_LENGTH = 100
# 百度语言代码映射ISO 639-1 → Baidu Code
BAIDU_LANG_MAP = {
'zh': 'zh',
'en': 'en',
'ko': 'kor',
'ja': 'jp',
'fr': 'fra',
'es': 'spa',
'ru': 'ru',
'de': 'de',
'pt': 'pt',
'it': 'it',
'ar': 'ara',
'th': 'th',
'vi': 'vie',
# 可继续扩展
}