Prevent determineSelectedLanguageCode() from failing for offline site
This commit is contained in:
parent
039026995a
commit
2f8b35365a
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue