Custom language switcher + Weglot subdomains: the switcher button doesn't stay on the current language

Switcher button reverts back to default language

I’m using Finsweet’s custom language switcher for Weglot. The site is in English (default) and Spanish. I’ve been using it on this site for a while with no problem. BUT:

I previously had Weglot set up to use javascript to translate the page. I read that it was better for performance and SEO to use subdomains instead of javascript. So I updated my Weglot settings and am now using subdomains.

When I click on the Espanol button, a couple things work successfully: the Finsweet custom switcher animation plays, and then the site successfully directs to the /es subdomain, and the page is translated. But once that Spanish page appears, the switcher button reverts back to its default state where it looks like English is the current language. If I click Espanol again, the animation plays and the button, stays in the Espanol state.

It seems like it must be a problem with having switched to subdomains, but I have another website that is set up this way with no problem.

Note: even though I switched the Weglot setup to translate using subdomains instead of javascript, I still have the Finsweet javascript in the body custom code - copied directly from their Weglot Switcher cloneable, but with my own API code pasted in (screengrab of their code below - btw that’s their fake api in the screen grab). I have the code pasted in the “below footer” custom code in the project settings - not at page level… but I tried both ways and this didn’t make a difference.

I appreciate any help! Details below…

Site URL

Steps to Reproduce

  1. click Espanol (bottom right corner) - page will translate via subdomain, but button will reset
  2. click Espanol again - page stays on Spanish, button animation plays again

Video/Screenshots