function updateURL() {
var currentURL = window.location.href;
var mainURL = currentURL.split('/').slice(0, 3).join('/');
var pageName = currentURL.split('/').slice(3).join('/');
var newURL;
if (currentURL.includes('/de')) {
newURL = currentURL.replace('/de', '');
} else {
newURL = mainURL + '/de/' + pageName;
}
window.location.href = newURL;
}
function updateURL() {
var currentURL = window.location.href;
var mainURL = currentURL.split('/').slice(0, 3).join('/');
var pageName = currentURL.split('/').slice(3).join('/');
var newURL;
if (currentURL.includes('/de')) {
newURL = currentURL.replace('/de', '');
} else {
newURL = mainURL + '/de/' + pageName;
}
window.location.href = newURL;
}