Hi I’m having an issue with my locales. I have some custom labels in my cart which I want to change up like this:
if (document.documentElement.lang === "en"){
document.addEventListener('snipcart.ready', function() {
Snipcart.api.session.setLanguage('en', {
actions: {
phone: "Phone number",
}
});
});
}
else if (document.documentElement.lang === "fr"){
document.addEventListener('snipcart.ready', function() {
Snipcart.api.session.setLanguage('fr', {
actions: {
phone: "Numéro de téléphone",
}
});
});
}
My english site is mysite.com
and my french site is mysite.com/fr
. The problem is that the labels don’t change on mysite.com/fr
.
What I’ve noticed is that my code works fine on the english site, I tested explicitly setting <html lang='fr'>
on mysite.com
and the labels work just fine in french.
So this isn’t a javascript issue so I’m wondering if I’m missing a step here, I tried registering mysite.com/fr in the control panel domains tab but it didn’t help.