From 046ad545aea021e0f8bd96f84d9665f462da3dab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcel=20St=C3=B6r?= Date: Mon, 28 Dec 2015 21:38:09 +0100 Subject: [PATCH] Fix String#split to determine selected language code --- docs/js/extra.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/js/extra.js b/docs/js/extra.js index 45ffeb50..9eb3b82d 100644 --- a/docs/js/extra.js +++ b/docs/js/extra.js @@ -74,7 +74,8 @@ var nodemcu = nodemcu || {}; var selectedLanguageCode, path = window.location.pathname; if (window.location.origin.indexOf('readthedocs') > -1) { // path is like /en///build/ -> extract 'lang' - selectedLanguageCode = path.split('/')[2]; + // split[0] is an '' because the path starts with the separator + selectedLanguageCode = path.split('/')[3]; } else { // path is like //build/ -> extract 'lang' selectedLanguageCode = path.substr(1, 2);