Skip to content

Commit fcf5d4a

Browse files
authored
Add PEP 545 redirects for the Persian translation (#648)
1 parent 59822f0 commit fcf5d4a

4 files changed

Lines changed: 67 additions & 2 deletions

File tree

‎salt/docs/config/nginx.docs-redirects.conf‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ location = / {
88
}
99

1010
# Python 3 docs are the default at the root of each translation.
11-
location ~ ^/(bn-in|de|el|es|fr|id|it|ja|ko|pl|pt-br|ro|ru|sv|tr|uk|zh-cn|zh-tw)/$ {
11+
location ~ ^/(bn-in|de|el|es|fa|fr|id|it|ja|ko|pl|pt-br|ro|ru|sv|tr|uk|zh-cn|zh-tw)/$ {
1212
return 302 $scheme://$host/$1/3/;
1313
}
1414

@@ -195,7 +195,7 @@ location ~ ^/((2|3)(\.[0-9]+)?|dev)/ {
195195
error_page 404 /$1/404.html;
196196
add_header Surrogate-Key en/$1 always;
197197
}
198-
location ~ ^/(bn-in|de|el|es|fr|id|it|ja|ko|pl|pt-br|ro|ru|tr|sv|uk|zh-cn|zh-tw)/((2|3)(\.[0-9]+)?|dev)/ {
198+
location ~ ^/(bn-in|de|el|es|fa|fr|id|it|ja|ko|pl|pt-br|ro|ru|tr|sv|uk|zh-cn|zh-tw)/((2|3)(\.[0-9]+)?|dev)/ {
199199
error_page 404 /$1/$2/404.html;
200200
add_header Surrogate-Key $1/$2 always;
201201
}

‎tests/docs-redirects/specs/PEP-594.hurl‎

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,21 @@ HTTP 301
6363
[Asserts]
6464
header "Location" == "https://localhost/es/3.14/"
6565

66+
GET {{host}}/fa/3/library/2to3.html
67+
HTTP 301
68+
[Asserts]
69+
header "Location" == "https://localhost/fa/3/"
70+
71+
GET {{host}}/fa/3.13/library/2to3.html
72+
HTTP 301
73+
[Asserts]
74+
header "Location" == "https://localhost/fa/3.13/"
75+
76+
GET {{host}}/fa/3.14/library/2to3.html
77+
HTTP 301
78+
[Asserts]
79+
header "Location" == "https://localhost/fa/3.14/"
80+
6681
GET {{host}}/fr/3/library/2to3.html
6782
HTTP 301
6883
[Asserts]
@@ -335,6 +350,21 @@ HTTP 301
335350
[Asserts]
336351
header "Location" == "https://localhost/es/3.14/"
337352

353+
GET {{host}}/fa/3/library/tkinter.tix.html
354+
HTTP 301
355+
[Asserts]
356+
header "Location" == "https://localhost/fa/3/"
357+
358+
GET {{host}}/fa/3.13/library/tkinter.tix.html
359+
HTTP 301
360+
[Asserts]
361+
header "Location" == "https://localhost/fa/3.13/"
362+
363+
GET {{host}}/fa/3.14/library/tkinter.tix.html
364+
HTTP 301
365+
[Asserts]
366+
header "Location" == "https://localhost/fa/3.14/"
367+
338368
GET {{host}}/fr/3/library/tkinter.tix.html
339369
HTTP 301
340370
[Asserts]

‎tests/docs-redirects/specs/default-root.hurl‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ HTTP 302
2323
[Asserts]
2424
header "Location" == "http://localhost/es/3/"
2525

26+
GET {{host}}/fa/
27+
HTTP 302
28+
[Asserts]
29+
header "Location" == "http://localhost/fa/3/"
30+
2631
GET {{host}}/fr/
2732
HTTP 302
2833
[Asserts]

‎tests/docs-redirects/specs/surrogate-key.hurl‎

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,36 @@ HTTP 404
385385
[Asserts]
386386
header "Surrogate-Key" == "es/dev"
387387

388+
GET {{host}}/fa/3/
389+
HTTP 404
390+
[Asserts]
391+
header "Surrogate-Key" == "fa/3"
392+
393+
GET {{host}}/fa/3/about.html
394+
HTTP 404
395+
[Asserts]
396+
header "Surrogate-Key" == "fa/3"
397+
398+
GET {{host}}/fa/3.14/
399+
HTTP 404
400+
[Asserts]
401+
header "Surrogate-Key" == "fa/3.14"
402+
403+
GET {{host}}/fa/3.14/about.html
404+
HTTP 404
405+
[Asserts]
406+
header "Surrogate-Key" == "fa/3.14"
407+
408+
GET {{host}}/fa/dev/
409+
HTTP 404
410+
[Asserts]
411+
header "Surrogate-Key" == "fa/dev"
412+
413+
GET {{host}}/fa/dev/about.html
414+
HTTP 404
415+
[Asserts]
416+
header "Surrogate-Key" == "fa/dev"
417+
388418
GET {{host}}/fr/3/
389419
HTTP 404
390420
[Asserts]

0 commit comments

Comments
 (0)