(Multilingual) Is there a workaround to translate Content Collection ?

Hey,

I just found out that Multilingual are finally available on Editor X. Great!
Now, I also realized you can’t translate your Content Collections…

I’m pretty sure there might be a workaround for this, using the currentLanguage but I don’t know much about code.

Basically I have a dynamic page with title, description… The main language is french and I want to translate to english. In my dataset, there are a titleFR and a titleEN columns (I’d prefer to change one dataset at once instead of creating two)

import wixWindow from 'wix-window';
if: wixWindow.multilingual.currentLanguage = "fr"; 

 some code that connects the #title to the #titleFR field (same with #description etc)
 
 if: wixWindow.multilingual.currentLanguage = "en";
 code that connects the #title to the #titleEN etc. 

Preferably I’d like not to use the collapse/expand functions as it’d be a mess to design if I have twice the amount of informations and impossible to control…

Has anyone find a solution?

Thanks :slight_smile:

Update, I more or less find how to do it but I don’t understand the Wix API. In my case, I want to connect the #title item to my dataset. According to the current language, I want to change its field source :

$w.onReady(function () {
if (wixWindow.multilingual.currentLanguage === 'en') {
$w('#title).
// SOME CODE HERE : that would basically connect the #title item to the titleEN field in my dataset//
}
else if (wixWindow.multilingual.currentLanguage === 'fr') {
$w('#title').
// SAME AS ABOVE : connect the #title item to the titleFR field from the dataset//
});

Hi - check this out: https://t.co/oyVESaU4Od and this https://t.co/d7a2HD7jak