diff --git a/app/javascript/packs/homePage.jsx b/app/javascript/packs/homePage.jsx index 7ea4ce50d..2ec4ddde6 100644 --- a/app/javascript/packs/homePage.jsx +++ b/app/javascript/packs/homePage.jsx @@ -63,9 +63,13 @@ function trackTagCogIconClicks() { }); } +function removeLocalePath(pathname) { + return pathname.replace(/^\/locale\/[a-zA-Z-]+\/?/, '/'); +} + function renderSidebar() { const sidebarContainer = document.getElementById('sidebar-wrapper-right'); - const { pathname } = window.location; + const pathname = removeLocalePath(window.location.pathname); // If the screen's width is less than 640 we don't need this extra data. if (