Skip to content

Commit 14bdc3a

Browse files
Add PEP 545 redirect for Swedish translation (#621)
1 parent d0a8c67 commit 14bdc3a

File tree

4 files changed

+67
-2
lines changed

4 files changed

+67
-2
lines changed

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|el|es|fr|id|it|ja|ko|pl|pt-br|ro|tr|uk|zh-cn|zh-tw)/$ {
11+
location ~ ^/(bn-in|el|es|fr|id|it|ja|ko|pl|pt-br|ro|sv|tr|uk|zh-cn|zh-tw)/$ {
1212
return 302 $scheme://$host/$1/3/;
1313
}
1414

@@ -190,7 +190,7 @@ location ~ ^/((2|3)(\.[0-9]+)?|dev)/\w+/[\d\w\.]+(?!\.html)$ {
190190
location ~ ^/((2|3)(\.[0-9]+)?|dev)/ {
191191
add_header Surrogate-Key en/$1 always;
192192
}
193-
location ~ ^/(bn-in|el|es|fr|id|it|ja|ko|pl|pt-br|ro|tr|uk|zh-cn|zh-tw)/((2|3)(\.[0-9]+)?|dev)/ {
193+
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)/ {
194194
add_header Surrogate-Key $1/$2 always;
195195
}
196196

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

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,21 @@ HTTP 301
183183
[Asserts]
184184
header "Location" == "https://localhost/ro/3.14/"
185185

186+
GET {{host}}/sv/3/library/2to3.html
187+
HTTP 301
188+
[Asserts]
189+
header "Location" == "https://localhost/sv/3/"
190+
191+
GET {{host}}/sv/3.13/library/2to3.html
192+
HTTP 301
193+
[Asserts]
194+
header "Location" == "https://localhost/sv/3.13/"
195+
196+
GET {{host}}/sv/3.14/library/2to3.html
197+
HTTP 301
198+
[Asserts]
199+
header "Location" == "https://localhost/sv/3.14/"
200+
186201
GET {{host}}/tr/3/library/2to3.html
187202
HTTP 301
188203
[Asserts]
@@ -425,6 +440,21 @@ HTTP 301
425440
[Asserts]
426441
header "Location" == "https://localhost/ro/3.14/"
427442

443+
GET {{host}}/sv/3/library/tkinter.tix.html
444+
HTTP 301
445+
[Asserts]
446+
header "Location" == "https://localhost/sv/3/"
447+
448+
GET {{host}}/sv/3.13/library/tkinter.tix.html
449+
HTTP 301
450+
[Asserts]
451+
header "Location" == "https://localhost/sv/3.13/"
452+
453+
GET {{host}}/sv/3.14/library/tkinter.tix.html
454+
HTTP 301
455+
[Asserts]
456+
header "Location" == "https://localhost/sv/3.14/"
457+
428458
GET {{host}}/tr/3/library/tkinter.tix.html
429459
HTTP 301
430460
[Asserts]

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,11 @@ HTTP 302
6363
[Asserts]
6464
header "Location" == "http://localhost/ro/3/"
6565

66+
GET {{host}}/sv/
67+
HTTP 302
68+
[Asserts]
69+
header "Location" == "http://localhost/sv/3/"
70+
6671
GET {{host}}/tr/
6772
HTTP 302
6873
[Asserts]

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

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -625,6 +625,36 @@ HTTP 404
625625
[Asserts]
626626
header "Surrogate-Key" == "ro/dev"
627627

628+
GET {{host}}/sv/3/
629+
HTTP 404
630+
[Asserts]
631+
header "Surrogate-Key" == "sv/3"
632+
633+
GET {{host}}/sv/3/about.html
634+
HTTP 404
635+
[Asserts]
636+
header "Surrogate-Key" == "sv/3"
637+
638+
GET {{host}}/sv/3.14/
639+
HTTP 404
640+
[Asserts]
641+
header "Surrogate-Key" == "sv/3.14"
642+
643+
GET {{host}}/sv/3.14/about.html
644+
HTTP 404
645+
[Asserts]
646+
header "Surrogate-Key" == "sv/3.14"
647+
648+
GET {{host}}/sv/dev/
649+
HTTP 404
650+
[Asserts]
651+
header "Surrogate-Key" == "sv/dev"
652+
653+
GET {{host}}/sv/dev/about.html
654+
HTTP 404
655+
[Asserts]
656+
header "Surrogate-Key" == "sv/dev"
657+
628658
GET {{host}}/tr/3/
629659
HTTP 404
630660
[Asserts]

0 commit comments

Comments
 (0)