Created
February 26, 2020 19:07
-
-
Save peterbe/2cdb4084601e309714410ebc29350d52 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/kuma/api/v1/tests/test_views.py b/kuma/api/v1/tests/test_views.py | |
index 297abf558..58e7f3270 100644 | |
--- a/kuma/api/v1/tests/test_views.py | |
+++ b/kuma/api/v1/tests/test_views.py | |
@@ -94,7 +94,11 @@ def test_doc_api(client, trans_doc): | |
for_wiki_site=True, | |
) | |
assert doc_data["translateURL"] == absolutify( | |
- reverse("wiki.select_locale", args=(trans_doc.slug,), locale=trans_doc.locale) | |
+ reverse( | |
+ "wiki.select_locale", | |
+ args=(trans_doc.parent.slug,), | |
+ locale=trans_doc.parent.locale, | |
+ ) | |
+ "?tolocale=fr", | |
for_wiki_site=True, | |
) | |
diff --git a/kuma/api/v1/views.py b/kuma/api/v1/views.py | |
index 63a12dbf8..009911245 100644 | |
--- a/kuma/api/v1/views.py | |
+++ b/kuma/api/v1/views.py | |
@@ -171,7 +171,11 @@ def document_api_data(doc=None, redirect_url=None): | |
), | |
"translateURL": ( | |
absolutify( | |
- reverse("wiki.select_locale", args=(doc.slug,), locale=doc.locale), | |
+ reverse( | |
+ "wiki.select_locale", | |
+ args=(doc.parent.slug,), | |
+ locale=doc.parent.locale, | |
+ ), | |
for_wiki_site=True, | |
) | |
+ f"?{urlencode(dict(tolocale=doc.locale))}" | |
diff --git a/kumascript b/kumascript | |
index c34f44b82..ed3f59e01 160000 | |
--- a/kumascript | |
+++ b/kumascript | |
@@ -1 +1 @@ | |
-Subproject commit c34f44b82747c16422bbaa5790578537f1f49b59 | |
+Subproject commit ed3f59e0167788330b92f72db45e6951487650c4 | |
diff --git a/locale b/locale | |
index 4bf7a03f4..c197f3c7a 160000 | |
--- a/locale | |
+++ b/locale | |
@@ -1 +1 @@ | |
-Subproject commit 4bf7a03f4bcccda52e957336ac7d37eea335db6e | |
+Subproject commit c197f3c7a41f137c916ed661a55eb7c3deb92941 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment