From 4a6d8f4186eabe432d130d338e326857a3c79f74 Mon Sep 17 00:00:00 2001 From: Yurii Motov Date: Wed, 4 Feb 2026 13:01:05 +0100 Subject: [PATCH] Add link to English version. Use modern syntax for details block --- docs/en/mkdocs.yml | 1 - docs/en/translation-banner.md | 12 ++++++++---- docs/ru/translation-banner.md | 12 ++++++++---- scripts/mkdocs_hooks.py | 2 ++ 4 files changed, 18 insertions(+), 9 deletions(-) diff --git a/docs/en/mkdocs.yml b/docs/en/mkdocs.yml index d90c2ece6..1c2954619 100644 --- a/docs/en/mkdocs.yml +++ b/docs/en/mkdocs.yml @@ -294,7 +294,6 @@ markdown_extensions: - info - check pymdownx.blocks.details: null - pymdownx.details: null pymdownx.blocks.tab: alternate_style: true mdx_include: null diff --git a/docs/en/translation-banner.md b/docs/en/translation-banner.md index fb99cce5d..753c88a6b 100644 --- a/docs/en/translation-banner.md +++ b/docs/en/translation-banner.md @@ -1,7 +1,11 @@ -??? note "🌐 Translation by AI and humans" +/// details | 🌐 Translation by AI and humans - This translation was made by AI guided by humans. 🤝 +This translation was made by AI guided by humans. 🤝 - It could have mistakes of misunderstanding the original meaning, or looking unnatural, etc. 🤖 +It could have mistakes of misunderstanding the original meaning, or looking unnatural, etc. 🤖 - You can improve this translation by [helping us guide the AI LLM better](https://fastapi.tiangolo.com/contributing/#translations). +You can improve this translation by [helping us guide the AI LLM better](https://fastapi.tiangolo.com/contributing/#translations). + +[English version](ENGLISH_VERSION_URL) + +/// \ No newline at end of file diff --git a/docs/ru/translation-banner.md b/docs/ru/translation-banner.md index f96fc8b20..aebc99d92 100644 --- a/docs/ru/translation-banner.md +++ b/docs/ru/translation-banner.md @@ -1,7 +1,11 @@ -??? note "🌐 Перевод выполнен с помощью ИИ и людей" +/// details | 🌐 Перевод выполнен с помощью ИИ и людей - Этот перевод был сделан ИИ под руководством людей. 🤝 +Этот перевод был сделан ИИ под руководством людей. 🤝 - В нем могут быть ошибки из-за неправильного понимания оригинального смысла или неестественности и т. д. 🤖 +В нем могут быть ошибки из-за неправильного понимания оригинального смысла или неестественности и т. д. 🤖 - Вы можете улучшить этот перевод, [помогая нам лучше направлять ИИ LLM](https://fastapi.tiangolo.com/contributing/#translations). +Вы можете улучшить этот перевод, [помогая нам лучше направлять ИИ LLM](https://fastapi.tiangolo.com/contributing/#translations). + +[Английская версия](ENGLISH_VERSION_URL) + +/// \ No newline at end of file diff --git a/scripts/mkdocs_hooks.py b/scripts/mkdocs_hooks.py index a88c229e5..0ac41a3ec 100644 --- a/scripts/mkdocs_hooks.py +++ b/scripts/mkdocs_hooks.py @@ -171,6 +171,8 @@ def on_page_markdown( # For translated pages add translation banner translation_banner_content = get_translation_banner_content(config.docs_dir) + en_url = "https://fastapi.tiangolo.com/" + page.url.lstrip("/") + translation_banner_content = translation_banner_content.replace("ENGLISH_VERSION_URL", en_url) header = "" body = markdown if markdown.startswith("#"):