Hi guys, i was trying to make a multi language dataset, and filter it. All’s ok, until a point, where when the user is already on the page of the item, and then decide to switch the language, the page obviously change it’s value to the selected language, but i cant make it goes to the other set of fields, where there’s the translation.
My database looks like this:
and this is what set up till now in my page code:
import wixWindow from “wix-window”;
import wixData from “wix-data”;
import wixLocation from “wix-location”;
let language = wixWindow.multilingual.currentLanguage;
let baseUrl = wixLocation.baseUrl + language;
$w.onReady( function () {
dataset1_ready();
});
export function mailtoinfo_onClick(event) {
$w(“#mailtoinfo”).link = “mailto:info@bluenliguria.com?subject=ciao”;
}
export function telcontact_onClick(event) {
$w(“#telcontact”).link = “tel:<+39-392-4878701>”;
}
export function buttonModerna_click_1(event, $w) {
wixData.query(“villa”)
.eq(“language”, language)
.eq(“title”, “MODERNA”)
.find()
.then( (results) => {
$w(“#repeater1”).data = results.items;
}
)
. catch ( (err) => {
let errorMsg = err;
});
}
export function buttonFamigliari_click(event, $w) {
wixData.query(“villa”)
.eq(“language”, language)
.eq(“title”, “FAMIGLIARE”)
.find()
.then( (results) => {
$w(“#repeater1”).data = results.items;
}
)
. catch ( (err) => {
let errorMsg = err;
});
}
export function dataset1_ready() {
$w(“#dataset1”).setFilter(wixData.filter().eq(“language”, language));
}
$w.onReady(() => {
$w(“#dataset1”).setFilter(wixData.filter().eq(“language”, language));
$w(“#dataset1”).onReady(() => {
$w(“#repeater1”).onItemReady(($item, itemData, index) => {
let descrizione = itemData.descrizioneSintetica;
var sintetica = descrizione.substr(0, 200);
$item(“#descrizioneSintetica”).text = sintetica + " … →";
});
});
});
Hope someone will help me to understand this issue…
Thank you,
Tytus.