take account of different languages

This commit is contained in:
scosti 2023-02-04 16:34:12 +01:00
parent 176fb0d1d0
commit c6ce87d65c

View file

@ -21,10 +21,12 @@ menuTrigger &&
window.addEventListener("resize", isMobileMenu); window.addEventListener("resize", isMobileMenu);
const language = document.getElementsByTagName('html')[0].lang;
const logo = document.querySelector(".logo__pathname"); const logo = document.querySelector(".logo__pathname");
if(logo){ if(logo){
window.onload = () => { window.onload = () => {
const path = window.location.pathname.substring(1); let path = window.location.pathname.substring(1);
path = path.replace(language+'/','')
logo.textContent += path.substring(0,path.indexOf('/')); logo.textContent += path.substring(0,path.indexOf('/'));
}; };
} }