Multilingual - currentLanguage always returns "en"

Hello, hope this is the right place for this. I am currently evaluating Wix as an CMS option for one of my clients. One major requirement is full support form multilingual content.

I have created a PoC site, implemented the Wix Multilingual feature and added one more language besides English. Looks very promising, however when I try to access the ‘currentLanguage’ setting in Preview Mode, I never get back anything else than “en”. Hopefully I am missing something, because this would be a dealbreaker.

// masterPage.js

import wixWindow from ‘wix-window’ ;

$w . onReady ( function () {
let language = wixWindow . multilingual . currentLanguage ;
console . log ( language );

Instant update: it turns out that in a Published site, this does behave as expected.

You are correct that the Live (published) site properly returns the correct language, while Preview does not. This might be due to the way that Preview works - Preview works in a different running environment than the Live site.

I’m going to bug a bunch of people till I get an answer. Then I’ll let you know what I found. And then we can have a beer.

OK, I’ve started turning over tables and lets see if I can get an answer.

Meanwhile, one thing that I noticed is that when switching languages, the site is refreshed . A site running in Preview won’t necessarily refresh, so that might be the issue. Let’s call this a Preview issue for now. I’ll update you when I get more information.