const userLang = navigator.language.toLowerCase(); const currentPath = window.location.pathname; // Check if they are NOT already on a French page AND their browser is French if (phApp.locale !== "fr_ca" && !currentPath.startsWith("/ca/fr")) { // If their language is fr-ca or fr-fr, trigger the redirect if (userLang === "fr-ca" || userLang === "fr-fr") { window.location.replace("https://jobs.kerry.com/ca/fr"); } }