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