We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2405f13 commit 4d34eb1Copy full SHA for 4d34eb1
assets/js/locale.js
@@ -5,10 +5,11 @@ $(document).ready(function() {
5
});
6
7
function loadLanguage(lang) {
8
+ base_pathname = window.location.pathname.replace(/^\/[a-z]+([_-][a-z]+)?\//, "/")
9
if (lang === "en") {
- url = window.location.pathname.replace(/^\/[a-z]+([_-][a-z]+)?\//, "/")
10
+ url = base_pathname
11
} else {
- url = "/" + lang + window.location.pathname
12
+ url = "/" + lang + base_pathname
13
}
14
window.location.assign(url);
15
0 commit comments