From 44d9db6a98d0a0ef32e8ff479e50c025ba4d7b2b Mon Sep 17 00:00:00 2001 From: yunchao Date: Fri, 18 Oct 2024 16:23:51 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=96=87=E6=A1=A3?= =?UTF-8?q?=E9=93=BE=E6=8E=A5=E5=A2=9E=E5=8A=A0=E8=AF=AD=E8=A8=80=E5=89=8D?= =?UTF-8?q?=E7=BC=80=20(closed=20#2459)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/context_processors.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/common/context_processors.py b/common/context_processors.py index f79ada7cb..fe10009e8 100644 --- a/common/context_processors.py +++ b/common/context_processors.py @@ -14,6 +14,7 @@ from blueapps.account.conf import ConfFixture from django.conf import settings +from django.utils.translation import get_language from django.utils.translation import ugettext as _ from version_log.utils import get_latest_version @@ -33,7 +34,8 @@ def get_docs_center_url(): version: str = get_latest_version() match = re.search(r"(\d+\.\d+)", version) major_minor_version: str = match.group() if match else version - docs_suffix: str = f"markdown/NodeMan/{major_minor_version}/UserGuide/Introduce/Overview.md" + language: str = "EN" if get_language() == "en" else "ZH" + docs_suffix: str = f"markdown/{language}/NodeMan/{major_minor_version}/UserGuide/Introduce/Overview.md" if settings.BK_DOCS_CENTER_HOST: docs_prefix = settings.BK_DOCS_CENTER_HOST return f"{docs_prefix}/{docs_suffix}"