diff --git a/blocks/header/header.js b/blocks/header/header.js index 2937eb73..73430699 100644 --- a/blocks/header/header.js +++ b/blocks/header/header.js @@ -7,9 +7,11 @@ import { onProfileUpdate, getUserDetails, } from '../../scripts/apis/user.js'; +import { i18nLookup } from '../../scripts/util.js'; // media query match that indicates mobile/tablet width const isDesktop = BREAKPOINTS.large; +let i18n; function closeOnEscape(e) { if (e.code === 'Escape') { @@ -139,7 +141,7 @@ function showHideNavProfile() { profileList.querySelector('.username').style.display = 'block'; const userDetails = getUserDetails(); const userDetailsLink = document.body.querySelector('.nav-profile .username a'); - userDetailsLink.textContent = userDetails?.profile?.firstName || 'Valued Customer'; + userDetailsLink.textContent = userDetails?.profile?.firstName || i18n('Valued Customer'); } else { profileList.querySelector('.login').style.display = 'block'; profileList.querySelector('.username').style.display = 'none'; @@ -155,15 +157,12 @@ function addProfileLogin(nav) { const profileMenu = document.createElement('ul'); profileMenu.innerHTML = ` -