mirror of
https://github.com/zhayujie/chatgpt-on-wechat.git
synced 2026-07-17 11:07:11 +08:00
fix(i18n): refine auto language fallback for deployments
This commit is contained in:
@@ -124,10 +124,12 @@ def detect_language():
|
|||||||
3. Python locale module
|
3. Python locale module
|
||||||
4. default English
|
4. default English
|
||||||
"""
|
"""
|
||||||
|
deployed = bool(os.environ.get("CLOUD_DEPLOYMENT_ID"))
|
||||||
return (
|
return (
|
||||||
_detect_from_macos()
|
_detect_from_macos()
|
||||||
or _detect_from_env()
|
or _detect_from_env()
|
||||||
or _detect_from_python_locale()
|
or _detect_from_python_locale()
|
||||||
|
or (ZH if deployed else None)
|
||||||
or DEFAULT_LANG
|
or DEFAULT_LANG
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user