Skip to content

Commit

Permalink
fix: 修复文档链接增加语言前缀 (closed TencentBlueKing#2459)
Browse files Browse the repository at this point in the history
  • Loading branch information
wyyalt committed Oct 18, 2024
1 parent f61c942 commit 44d9db6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion common/context_processors.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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}"
Expand Down

0 comments on commit 44d9db6

Please sign in to comment.