refactor(backend): dify, minio等迁移到integration,清除无效文件
This commit is contained in:
1 parent
7fe7a39384
commit
faa554ade4
90 files changed
+7540
-9649
No files matched your search
@@ -2,7 +2,7 @@
|
||||
services/shipping_notice/i18n.py
|
||||
|
||||
用途:维护发货通知链路的多语言文案与语言解析工具。
|
||||
依赖:Flask request 上下文、模块内 `_MESSAGES` 文案字典。
|
||||
依赖:core.http_context、模块内 `_MESSAGES` 文案字典。
|
||||
逻辑:由 parse_summary、field_alignment_summary、workflow 提示文案等上游模块调用本文件输出用户可读消息。
|
||||
"""
|
||||
|
||||
@@ -10,7 +10,7 @@ from __future__ import annotations
|
||||
|
||||
from typing import Any
|
||||
|
||||
from flask import has_request_context, request
|
||||
from app.core.http_context import has_http_request, header
|
||||
|
||||
SUPPORTED_LANGS = ("zh", "en", "th")
|
||||
|
||||
@@ -422,11 +422,11 @@ def resolve_lang(payload: dict[str, Any] | None = None) -> str:
|
||||
if val:
|
||||
return normalize_lang(val)
|
||||
|
||||
if has_request_context():
|
||||
hdr = str(request.headers.get("X-Lang") or "").strip()
|
||||
if has_http_request():
|
||||
hdr = header("X-Lang").strip()
|
||||
if hdr:
|
||||
return normalize_lang(hdr)
|
||||
accept = str(request.headers.get("Accept-Language") or "").strip()
|
||||
accept = header("Accept-Language").strip()
|
||||
if accept:
|
||||
return normalize_lang(accept.split(",")[0].strip())
|
||||
return "zh"
|
||||
|
||||
Reference in new issue
Block a user