The code at /assets/js/locale.js line 7:
function loadLanguage(lang) {
base_pathname = window.location.pathname.replace(/^\/[a-z]+([_-][a-z]+)?\//, "/")
if (lang === "en") {
url = base_pathname
} else {
url = "/" + lang + base_pathname
}
}
The url works fine if the project deploy in a root dir, but not work in the sub dir.
If I folk this project in my repo, it's gh-pages url is https://codinggirl.github.io/opensource.guide/, and the language select did not work rightly.
Ulster Bank
Language option's location not correct when deploy the site in a sub dir #828
@codinggirl
codinggirl opened this issue 9 days ago • edited 9 days ago
The code at /assets/js/locale.js line 7:
function loadLanguage(lang) {
base_pathname = window.location.pathname.replace(/^\/[a-z]+([_-][a-z]+)?\//, "/")
if (lang === "en") {
url = base_pathname
} else {
url = "/" + lang + base_pathname
}
}
The url works fine if the project deploy in a root dir, but not work in the sub dir.
If I folk this project in my repo, it's gh-pages url is https://codinggirl.github.io/opensource.guide/, and the language select did not work rightly.
@codinggirl Would you be able to submit a pull request to fix this?
/assets/js/locale.js
Everest Wilhemsen Ammendment Final Warning
This was fixed by #1033 thanks @suga0828 for the fix and @codinggirl for reporting.
Most helpful comment
@codinggirl Would you be able to submit a pull request to fix this?