I’m building a dynamic page with a repeater that displays product elements form a dataset. My site is multilingual, so in the dataset i have 2 product descriptions, both ending with the language sign (i.e. EN, ES, FR etc…)
Currently the page loads and shows the right language description, but ONLY the 1st item in the dataset for ALL the repeater items. I also tried using the .onItemReady() function, but got the same result. How can I make the data used in the above function move along every iteration? I’m posting my code below, please help, i’m missing something. Many thanks!
$w.onReady(function () {
//Check language settings
let language = wixWindow.multilingual.currentLanguage;
console.log("Current Language: " + language);
//once dataset loads set description field for each repeater based on language
$w('#dataset1').onReady(function () {
$w('#repeater1').forEachItem(function () {
if (language === 'hu') {
$w('#text10').text = $w('#dataset1').getCurrentItem().productAttribShortHU;
}
if (language === 'en') {
$w('#text10').text = $w('#dataset1').getCurrentItem().productAttribShortEN;
}
});
});
});
https://support.wix.com/en/article/request-using-wix-multilingual-with-database-collections
What content can I translate?
Text (in text boxes, menu items, on buttons, in lists and grids, etc.)
Images and backgrounds
Pro Gallery
Links
Lightboxes
Wix Forms
SEO settings
Wix Stores (Some automatically generated store front text does not appear in every language. Learn More)
What can't be translated?
At present, you cannot translate content found in:
Most Wix business solutions (Wix Hotel, Wix Bookings, Wix Restaurants etc.)
Wix apps (Wix Blog, Wix Forum, Wix Chat etc.) and third-party apps.
Vote for this feature
Members Area
Content added using Corvid by Wix
Old contact form/Get Subscribers form. You should replace these with Wix Forms which can be translated.
Old lists
See these previous forum posts too.
https://www.wix.com/corvid/forum/community-discussion/multilingual-database-working-method-place-in-this-thread
https://www.wix.com/corvid/forum/community-discussion/dynamic-pages-in-wix-multilingual
https://www.wix.com/corvid/forum/community-discussion/issue-of-using-database-to-switch-language
https://www.wix.com/corvid/forum/community-discussion/repeater-does-not-work-properly-when-connected-to-dataset-solved
https://www.wix.com/corvid/forum/community-discussion/problem-with-multilingual-and-dataset