Prevent determineSelectedLanguageCode() from failing for offline site

This commit is contained in:
Marcel Stör 2017-04-16 20:31:38 +02:00
parent 039026995a
commit 2f8b35365a
1 changed files with 1 additions and 1 deletions

View File

@ -181,7 +181,7 @@ var nodemcu = nodemcu || {};
// path is like /en/<branch>/<lang>/build/ -> extract 'lang' // path is like /en/<branch>/<lang>/build/ -> extract 'lang'
// split[0] is an '' because the path starts with the separator // split[0] is an '' because the path starts with the separator
selectedLanguageCode = path.split('/')[3]; selectedLanguageCode = path.split('/')[3];
} else { } else if (!window.location.href.startsWith('file://')) {
// path is like /<lang>/build/ -> extract 'lang' // path is like /<lang>/build/ -> extract 'lang'
selectedLanguageCode = path.substr(1, 2); selectedLanguageCode = path.substr(1, 2);
} }