[Python-checkins] bpo-31146: Don't fallback switcher to english on not-yet pusblished languages. (GH-10558)

Miss Islington (bot) webhook-mailer at python.org
Wed Nov 21 17:46:34 EST 2018


https://github.com/python/cpython/commit/df6374e15aadff7eb547fc210c0f4f28bbff7010
commit: df6374e15aadff7eb547fc210c0f4f28bbff7010
branch: 3.7
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: GitHub <noreply at github.com>
date: 2018-11-21T14:46:30-08:00
summary:

bpo-31146: Don't fallback switcher to english on not-yet pusblished languages. (GH-10558)

(cherry picked from commit 6b73bb523a176123a819e4ebac3727d31d861515)

Co-authored-by: Julien Palard <julien at palard.fr>

files:
M Doc/tools/static/switchers.js

diff --git a/Doc/tools/static/switchers.js b/Doc/tools/static/switchers.js
index d885ff2bbf21..20dad93d6a5e 100644
--- a/Doc/tools/static/switchers.js
+++ b/Doc/tools/static/switchers.js
@@ -49,6 +49,12 @@
       else
         buf.push('<option value="' + language + '">' + title + '</option>');
     });
+    if (!(current_language in all_languages)) {
+        // In case we're browsing a language that is not yet in all_languages.
+        buf.push('<option value="' + current_language + '" selected="selected">' +
+                 current_language + '</option>');
+        all_languages[current_language] = current_language;
+    }
     buf.push('</select>');
     return buf.join('');
   }



More information about the Python-checkins mailing list