From 36308a5d4b4559043abe916578cc200b9d2a325a Mon Sep 17 00:00:00 2001 From: Sepehr Rasouli Date: Tue, 18 Aug 2026 12:59:50 +0330 Subject: [PATCH 1/3] Add PEP 545 redirect for Persian translation --- salt/docs/config/nginx.docs-redirects.conf | 4 +-- tests/docs-redirects/specs/PEP-594.hurl | 31 +++++++++++++++++++ tests/docs-redirects/specs/default-root.hurl | 5 +++ tests/docs-redirects/specs/surrogate-key.hurl | 30 ++++++++++++++++++ 4 files changed, 68 insertions(+), 2 deletions(-) diff --git a/salt/docs/config/nginx.docs-redirects.conf b/salt/docs/config/nginx.docs-redirects.conf index d150d5d2..3d4826ea 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|sv|fa|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|tr|sv|fa|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..14cd1080 100644 --- a/tests/docs-redirects/specs/PEP-594.hurl +++ b/tests/docs-redirects/specs/PEP-594.hurl @@ -198,6 +198,21 @@ HTTP 301 [Asserts] header "Location" == "https://localhost/sv/3.14/" +GET {{host}}/fa/3/library/2to3.html +HTTP 301 +[Asserts] +header "Location" == "https://localhost/fa/3/" + +GET {{host}}/fa/3.13/library/2to3.html +HTTP 301 +[Asserts] +header "Location" == "https://localhost/fa/3.13/" + +GET {{host}}/fa/3.14/library/2to3.html +HTTP 301 +[Asserts] +header "Location" == "https://localhost/fa/3.14/" + GET {{host}}/tr/3/library/2to3.html HTTP 301 [Asserts] @@ -455,6 +470,22 @@ HTTP 301 [Asserts] header "Location" == "https://localhost/sv/3.14/" +GET {{host}}/fa/3/library/tkinter.tix.html +HTTP 301 +[Asserts] +header "Location" == "https://localhost/fa/3/" + +GET {{host}}/fa/3.13/library/tkinter.tix.html +HTTP 301 +[Asserts] +header "Location" == "https://localhost/fa/3.13/" + +GET {{host}}/fa/3.14/library/tkinter.tix.html +HTTP 301 +[Asserts] +header "Location" == "https://localhost/fa/3.14/" + + GET {{host}}/tr/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..9df3e736 100644 --- a/tests/docs-redirects/specs/default-root.hurl +++ b/tests/docs-redirects/specs/default-root.hurl @@ -68,6 +68,11 @@ HTTP 302 [Asserts] header "Location" == "http://localhost/sv/3/" +GET {{host}}/fa/ +HTTP 302 +[Asserts] +header "Location" == "http://localhost/fa/3/" + GET {{host}}/tr/ HTTP 302 [Asserts] diff --git a/tests/docs-redirects/specs/surrogate-key.hurl b/tests/docs-redirects/specs/surrogate-key.hurl index 13c912bf..7f085daf 100644 --- a/tests/docs-redirects/specs/surrogate-key.hurl +++ b/tests/docs-redirects/specs/surrogate-key.hurl @@ -655,6 +655,36 @@ HTTP 404 [Asserts] header "Surrogate-Key" == "sv/dev" +GET {{host}}/fa/3/ +HTTP 404 +[Asserts] +header "Surrogate-Key" == "fa/3" + +GET {{host}}/fa/3/about.html +HTTP 404 +[Asserts] +header "Surrogate-Key" == "fa/3" + +GET {{host}}/fa/3.14/ +HTTP 404 +[Asserts] +header "Surrogate-Key" == "fa/3.14" + +GET {{host}}/fa/3.14/about.html +HTTP 404 +[Asserts] +header "Surrogate-Key" == "fa/3.14" + +GET {{host}}/fa/dev/ +HTTP 404 +[Asserts] +header "Surrogate-Key" == "fa/dev" + +GET {{host}}/fa/dev/about.html +HTTP 404 +[Asserts] +header "Surrogate-Key" == "fa/dev" + GET {{host}}/tr/3/ HTTP 404 [Asserts] From 2cb0931d4b838483a780660bfc05e8eaa9b7f08a Mon Sep 17 00:00:00 2001 From: Sepehr Rasouli Date: Tue, 18 Aug 2026 13:10:30 +0330 Subject: [PATCH 2/3] Update nginx.docs-redirects.conf --- salt/docs/config/nginx.docs-redirects.conf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/salt/docs/config/nginx.docs-redirects.conf b/salt/docs/config/nginx.docs-redirects.conf index 3d4826ea..c1337d72 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|fa|tr|uk|zh-cn|zh-tw)/$ { +location ~ ^/(bn-in|el|es|fa|fr|id|it|ja|ko|pl|pt-br|ro|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|fa|uk|zh-cn|zh-tw)/((2|3)(\.[0-9]+)?|dev)/ { +location ~ ^/(bn-in|el|es|fa|fr|id|it|ja|ko|pl|pt-br|ro|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; } From 6c9d0c77c630e490a448362767e9b2bdc26aabb6 Mon Sep 17 00:00:00 2001 From: Sepehr Rasouli Date: Tue, 18 Aug 2026 13:18:09 +0330 Subject: [PATCH 3/3] Re-order entries alphabetically --- tests/docs-redirects/specs/PEP-594.hurl | 61 +++++++++---------- tests/docs-redirects/specs/default-root.hurl | 10 +-- tests/docs-redirects/specs/surrogate-key.hurl | 60 +++++++++--------- 3 files changed, 65 insertions(+), 66 deletions(-) diff --git a/tests/docs-redirects/specs/PEP-594.hurl b/tests/docs-redirects/specs/PEP-594.hurl index 14cd1080..ad90cd8c 100644 --- a/tests/docs-redirects/specs/PEP-594.hurl +++ b/tests/docs-redirects/specs/PEP-594.hurl @@ -63,6 +63,21 @@ HTTP 301 [Asserts] header "Location" == "https://localhost/es/3.14/" +GET {{host}}/fa/3/library/2to3.html +HTTP 301 +[Asserts] +header "Location" == "https://localhost/fa/3/" + +GET {{host}}/fa/3.13/library/2to3.html +HTTP 301 +[Asserts] +header "Location" == "https://localhost/fa/3.13/" + +GET {{host}}/fa/3.14/library/2to3.html +HTTP 301 +[Asserts] +header "Location" == "https://localhost/fa/3.14/" + GET {{host}}/fr/3/library/2to3.html HTTP 301 [Asserts] @@ -198,21 +213,6 @@ HTTP 301 [Asserts] header "Location" == "https://localhost/sv/3.14/" -GET {{host}}/fa/3/library/2to3.html -HTTP 301 -[Asserts] -header "Location" == "https://localhost/fa/3/" - -GET {{host}}/fa/3.13/library/2to3.html -HTTP 301 -[Asserts] -header "Location" == "https://localhost/fa/3.13/" - -GET {{host}}/fa/3.14/library/2to3.html -HTTP 301 -[Asserts] -header "Location" == "https://localhost/fa/3.14/" - GET {{host}}/tr/3/library/2to3.html HTTP 301 [Asserts] @@ -335,6 +335,21 @@ HTTP 301 [Asserts] header "Location" == "https://localhost/es/3.14/" +GET {{host}}/fa/3/library/tkinter.tix.html +HTTP 301 +[Asserts] +header "Location" == "https://localhost/fa/3/" + +GET {{host}}/fa/3.13/library/tkinter.tix.html +HTTP 301 +[Asserts] +header "Location" == "https://localhost/fa/3.13/" + +GET {{host}}/fa/3.14/library/tkinter.tix.html +HTTP 301 +[Asserts] +header "Location" == "https://localhost/fa/3.14/" + GET {{host}}/fr/3/library/tkinter.tix.html HTTP 301 [Asserts] @@ -470,22 +485,6 @@ HTTP 301 [Asserts] header "Location" == "https://localhost/sv/3.14/" -GET {{host}}/fa/3/library/tkinter.tix.html -HTTP 301 -[Asserts] -header "Location" == "https://localhost/fa/3/" - -GET {{host}}/fa/3.13/library/tkinter.tix.html -HTTP 301 -[Asserts] -header "Location" == "https://localhost/fa/3.13/" - -GET {{host}}/fa/3.14/library/tkinter.tix.html -HTTP 301 -[Asserts] -header "Location" == "https://localhost/fa/3.14/" - - GET {{host}}/tr/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 9df3e736..490af0c2 100644 --- a/tests/docs-redirects/specs/default-root.hurl +++ b/tests/docs-redirects/specs/default-root.hurl @@ -23,6 +23,11 @@ HTTP 302 [Asserts] header "Location" == "http://localhost/es/3/" +GET {{host}}/fa/ +HTTP 302 +[Asserts] +header "Location" == "http://localhost/fa/3/" + GET {{host}}/fr/ HTTP 302 [Asserts] @@ -68,11 +73,6 @@ HTTP 302 [Asserts] header "Location" == "http://localhost/sv/3/" -GET {{host}}/fa/ -HTTP 302 -[Asserts] -header "Location" == "http://localhost/fa/3/" - GET {{host}}/tr/ HTTP 302 [Asserts] diff --git a/tests/docs-redirects/specs/surrogate-key.hurl b/tests/docs-redirects/specs/surrogate-key.hurl index 7f085daf..fd6b7225 100644 --- a/tests/docs-redirects/specs/surrogate-key.hurl +++ b/tests/docs-redirects/specs/surrogate-key.hurl @@ -385,6 +385,36 @@ HTTP 404 [Asserts] header "Surrogate-Key" == "es/dev" +GET {{host}}/fa/3/ +HTTP 404 +[Asserts] +header "Surrogate-Key" == "fa/3" + +GET {{host}}/fa/3/about.html +HTTP 404 +[Asserts] +header "Surrogate-Key" == "fa/3" + +GET {{host}}/fa/3.14/ +HTTP 404 +[Asserts] +header "Surrogate-Key" == "fa/3.14" + +GET {{host}}/fa/3.14/about.html +HTTP 404 +[Asserts] +header "Surrogate-Key" == "fa/3.14" + +GET {{host}}/fa/dev/ +HTTP 404 +[Asserts] +header "Surrogate-Key" == "fa/dev" + +GET {{host}}/fa/dev/about.html +HTTP 404 +[Asserts] +header "Surrogate-Key" == "fa/dev" + GET {{host}}/fr/3/ HTTP 404 [Asserts] @@ -655,36 +685,6 @@ HTTP 404 [Asserts] header "Surrogate-Key" == "sv/dev" -GET {{host}}/fa/3/ -HTTP 404 -[Asserts] -header "Surrogate-Key" == "fa/3" - -GET {{host}}/fa/3/about.html -HTTP 404 -[Asserts] -header "Surrogate-Key" == "fa/3" - -GET {{host}}/fa/3.14/ -HTTP 404 -[Asserts] -header "Surrogate-Key" == "fa/3.14" - -GET {{host}}/fa/3.14/about.html -HTTP 404 -[Asserts] -header "Surrogate-Key" == "fa/3.14" - -GET {{host}}/fa/dev/ -HTTP 404 -[Asserts] -header "Surrogate-Key" == "fa/dev" - -GET {{host}}/fa/dev/about.html -HTTP 404 -[Asserts] -header "Surrogate-Key" == "fa/dev" - GET {{host}}/tr/3/ HTTP 404 [Asserts]