Skip to content

Commit

Permalink
feat: 文档中心跳转支持中英文 --story=132104161
Browse files Browse the repository at this point in the history
  • Loading branch information
normal-wls committed Oct 14, 2024
1 parent cab86f6 commit 10f7465
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion bkflow/interface/context_processors.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ def bkflow_settings(request):
frontend_entry_url = "{}bkflow".format(settings.STATIC_URL) if settings.RUN_VER == "open" else "/static/bkflow"
enable_notice_center = int(EnvironmentVariables.objects.get_var("ENABLE_NOTICE_CENTER", 0))
language = request.COOKIES.get("blueking_language", "zh-cn")
doc_lang_mappings = {"zh-cn": "ZH", "en": "EN"}
run_ver_key = "BKAPP_RUN_VER_NAME" if language == "zh-cn" else "BKAPP_RUN_VER_NAME_{}".format(language.upper())

ctx = {
Expand All @@ -36,7 +37,8 @@ def bkflow_settings(request):
"MEMBER_SELECTOR_DATA_HOST": settings.MEMBER_SELECTOR_DATA_HOST,
"APP_CODE": settings.APP_CODE,
"USERNAME": request.user.username,
"BK_DOC_URL": f"{env.BK_DOC_CENTER_HOST}/markdown/ZH/BKFlow/1.8/UserGuide/Introduce/introduce.md",
"BK_DOC_URL": f"{env.BK_DOC_CENTER_HOST}/markdown/{doc_lang_mappings.get(language, 'ZH')}/BKFlow/1.8"
f"/UserGuide/Introduce/introduce.md",
# 是否开启通知中心
"ENABLE_NOTICE_CENTER": enable_notice_center,
"BK_PAAS_SHARED_RES_URL": env.BKPAAS_SHARED_RES_URL,
Expand Down

0 comments on commit 10f7465

Please sign in to comment.