From 203c7125e01f87e1676bbf2d7e18e0359c080097 Mon Sep 17 00:00:00 2001 From: MLGRussianXP Date: Thu, 13 Aug 2026 18:23:59 +0300 Subject: [PATCH] Add PEP 545 redirect for Russian translation --- salt/docs/config/nginx.docs-redirects.conf | 4 +-- tests/docs-redirects/specs/PEP-594.hurl | 30 +++++++++++++++++++ tests/docs-redirects/specs/default-root.hurl | 5 ++++ tests/docs-redirects/specs/surrogate-key.hurl | 30 +++++++++++++++++++ 4 files changed, 67 insertions(+), 2 deletions(-) diff --git a/salt/docs/config/nginx.docs-redirects.conf b/salt/docs/config/nginx.docs-redirects.conf index d150d5d2..a0201d89 100644 --- a/salt/docs/config/nginx.docs-redirects.conf +++ b/salt/docs/config/nginx.docs-redirects.conf @@ -8,7 +8,7 @@ location = / { } # Python 3 docs are the default at the root of each translation. -location ~ ^/(bn-in|el|es|fr|id|it|ja|ko|pl|pt-br|ro|sv|tr|uk|zh-cn|zh-tw)/$ { +location ~ ^/(bn-in|el|es|fr|id|it|ja|ko|pl|pt-br|ro|ru|sv|tr|uk|zh-cn|zh-tw)/$ { return 302 $scheme://$host/$1/3/; } @@ -192,7 +192,7 @@ location ~ ^/((2|3)(\.[0-9]+)?|dev)/ { error_page 404 /$1/404.html; add_header Surrogate-Key en/$1 always; } -location ~ ^/(bn-in|el|es|fr|id|it|ja|ko|pl|pt-br|ro|tr|sv|uk|zh-cn|zh-tw)/((2|3)(\.[0-9]+)?|dev)/ { +location ~ ^/(bn-in|el|es|fr|id|it|ja|ko|pl|pt-br|ro|ru|tr|sv|uk|zh-cn|zh-tw)/((2|3)(\.[0-9]+)?|dev)/ { error_page 404 /$1/$2/404.html; add_header Surrogate-Key $1/$2 always; } diff --git a/tests/docs-redirects/specs/PEP-594.hurl b/tests/docs-redirects/specs/PEP-594.hurl index 0036a2ca..0613626c 100644 --- a/tests/docs-redirects/specs/PEP-594.hurl +++ b/tests/docs-redirects/specs/PEP-594.hurl @@ -183,6 +183,21 @@ HTTP 301 [Asserts] header "Location" == "https://localhost/ro/3.14/" +GET {{host}}/ru/3/library/2to3.html +HTTP 301 +[Asserts] +header "Location" == "https://localhost/ru/3/" + +GET {{host}}/ru/3.13/library/2to3.html +HTTP 301 +[Asserts] +header "Location" == "https://localhost/ru/3.13/" + +GET {{host}}/ru/3.14/library/2to3.html +HTTP 301 +[Asserts] +header "Location" == "https://localhost/ru/3.14/" + GET {{host}}/sv/3/library/2to3.html HTTP 301 [Asserts] @@ -440,6 +455,21 @@ HTTP 301 [Asserts] header "Location" == "https://localhost/ro/3.14/" +GET {{host}}/ru/3/library/tkinter.tix.html +HTTP 301 +[Asserts] +header "Location" == "https://localhost/ru/3/" + +GET {{host}}/ru/3.13/library/tkinter.tix.html +HTTP 301 +[Asserts] +header "Location" == "https://localhost/ru/3.13/" + +GET {{host}}/ru/3.14/library/tkinter.tix.html +HTTP 301 +[Asserts] +header "Location" == "https://localhost/ru/3.14/" + GET {{host}}/sv/3/library/tkinter.tix.html HTTP 301 [Asserts] diff --git a/tests/docs-redirects/specs/default-root.hurl b/tests/docs-redirects/specs/default-root.hurl index 6bc44202..90c091bc 100644 --- a/tests/docs-redirects/specs/default-root.hurl +++ b/tests/docs-redirects/specs/default-root.hurl @@ -63,6 +63,11 @@ HTTP 302 [Asserts] header "Location" == "http://localhost/ro/3/" +GET {{host}}/ru/ +HTTP 302 +[Asserts] +header "Location" == "http://localhost/ru/3/" + GET {{host}}/sv/ HTTP 302 [Asserts] diff --git a/tests/docs-redirects/specs/surrogate-key.hurl b/tests/docs-redirects/specs/surrogate-key.hurl index 13c912bf..3a4374c6 100644 --- a/tests/docs-redirects/specs/surrogate-key.hurl +++ b/tests/docs-redirects/specs/surrogate-key.hurl @@ -625,6 +625,36 @@ HTTP 404 [Asserts] header "Surrogate-Key" == "ro/dev" +GET {{host}}/ru/3/ +HTTP 404 +[Asserts] +header "Surrogate-Key" == "ru/3" + +GET {{host}}/ru/3/about.html +HTTP 404 +[Asserts] +header "Surrogate-Key" == "ru/3" + +GET {{host}}/ru/3.14/ +HTTP 404 +[Asserts] +header "Surrogate-Key" == "ru/3.14" + +GET {{host}}/ru/3.14/about.html +HTTP 404 +[Asserts] +header "Surrogate-Key" == "ru/3.14" + +GET {{host}}/ru/dev/ +HTTP 404 +[Asserts] +header "Surrogate-Key" == "ru/dev" + +GET {{host}}/ru/dev/about.html +HTTP 404 +[Asserts] +header "Surrogate-Key" == "ru/dev" + GET {{host}}/sv/3/ HTTP 404 [Asserts]