]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-31146: Don't fallback switcher to english on not-yet pusblished languages. (GH...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Wed, 21 Nov 2018 22:46:57 +0000 (14:46 -0800)
committerGitHub <noreply@github.com>
Wed, 21 Nov 2018 22:46:57 +0000 (14:46 -0800)
(cherry picked from commit 6b73bb523a176123a819e4ebac3727d31d861515)

Co-authored-by: Julien Palard <julien@palard.fr>
Doc/tools/static/switchers.js

index d885ff2bbf2166a75dba29664daacd0afab1c0e9..20dad93d6a5edf46058f1d6dfbca77bcfc66c4e3 100644 (file)
       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('');
   }