I tried to use this setup for letting the current logged in members choise of language be activated but for some reason the last of the languages in the list is instead activated. That means that the system can´t recognize who the member is which is strange to me because it recognizes the correct members photo with almost same kind of code (just “undefined” instead of “false” but undefined makes no difference when it comes to languages):
let _owner = wixUsers.currentUser;
let userId = _owner.id;
wixData.get(“Members”, userId)
.then((item) => {
if (item.language.spanish === false) {
console.log(“no spanish”);
} else {
$w(“#button7”).label = “Vídeos”;
$w(“#button4”).label = “Remolques”;
$w(“#button17”).label = “Fotos”;
$w(“#profile”).label = “Perfil”;
$w(“#account”).label = “Cuenta”;
$w(“#logout”).label = “Dejar”;
$w(“#button20”).label = “Edita tu info”;
$w(“#text367”).text = “Su cuenta personal”;
$w(“#text370”).text = “Información pública”;
$w(“#text369”).text = “Apodo”;
$w(“#text373”).text = “Género”;
$w(“#text374”).text = “Edad 2025”;
$w(“#swePhoto”).collapse();
$w(“#araPhoto”).collapse();
$w(“#eng2”).collapse();
$w(“#eng3”).collapse();
$w(“#eng4”).collapse();
$w(“#eng5”).collapse();
$w(“#english”).collapse();
$w(“#spanish”).collapse();
$w(“#spaKeepOr”).expand();
$w(“#spaPhoto”).expand();
$w(“#english”).expand();
$w(“#french”).expand();
$w(“#german”).expand();
$w(“#swedish”).expand();
$w(“#arabic”).expand();
console.log(“spanish”);
}
This is the code for getting the correct members photo and that works perfectly:
wixData.get(“Members”, userId)
.then((item) => {
if (item.picture === undefined) {
console.log(“no image”);
} else {
$w(“#image72”).src = (item.picture);
}
Product:
[Wix Editor, Wix Studio Editor.]
What are you trying to achieve:
[The system shall recognize who the currently logged in member is (owner) and display all texts in the members prefered language.].