Multistate box + lightbox + multilingual code help

Hi, I have a problem with getting the multistate box to work inside of a lightbox for a multilingual site. It is a very important flow for me, as I’m showing customers a signup form in their own language which enrolls them in a language-specific flow of emails.

Here is the code that I’m using for a multistate box that IS NOT in a lightbox and that works great! (This is in my masterPage.js file, as I’m using this multistate box in my footer).
import wixWindow from ‘wix-window’ ;
const current_language = [ ‘et’ ];
$w.onReady( function () {
let lang = wixWindow.multilingual.currentLanguage;
//based on current_language
/////////////////////////////////////
if (current_language.includes(lang)){
$w( ‘#statebox8’ ).changeState( ‘estonian’ );
}

else {
$w( ‘#statebox8’ ).changeState( ‘english’ );

} 

});


Here is the code for a multistate box that IS inside of a lightbox and the odd thing is that it works in Preview, but not in production! (This code is only in the Lightbox file, as the multistate box is only in the Lightbox).
import wixWindow from ‘wix-window’ ;
const current_language = [ ‘et’ ];
$w.onReady( function () {
let lang = wixWindow.multilingual.currentLanguage;
//based on current_language
/////////////////////////////////////
if (current_language.includes(lang)){
$w( ‘#statebox9’ ).changeState( ‘estonian2’ );
}

else {
$w( ‘#statebox9’ ).changeState( ‘english2’ );

} 

});


Any help would be much appreciated!

Please post the URL, and explain how to see this problem in the Live site.

Hey Yisrael, thank you for looking into this!

Website: https://et.carefab.com/

How to replicate:
If you click on the top black banner the lightbox will pop open.

The first field in the form should say “Eesnimi” - which it does when I use the Preview in my editor.

But on the live web instead, it asks you for “First Name” which is the English version of the multistate box. This means the multistatebox hasn’t changed the state to the other language.

Hey @yisrael-wix , checking if you were able to see the cause for this. Much appreciated!

The issue appears to be related to a recent performance release. I am passing this on to QA for evaluation.

A ticket has been opened concerning this issue.
Also, your site was set to run on the older system so it should work OK now.

Hey @yisrael-wix , yes indeed it works as intended now! Thank you for helping out here :slight_smile: