In WixStudio I have installed the multilingual app
My website is translated into 2 languages.
Users can pick language based on WIX language drop-down/toggle
I can - for own created automation emails/flows - define language versions for the emails (it is not possible to have the preinstalled automations in multiple languages)
So far all good ….
However, I can not figure out how to automatically set the language for members when they register themselves on my website. Without the language being set, I can not control which language version of an automated email (I.e. welcome mail) a member gets. How can I automatically set the language or control that members get the correct language version of an automation email?
Hello,
I have the same issue…
Did you find a solution so far?
Thank
Yes - I found a solution. It is a bit tricky but I try to explain:
Step 1: In the signup form, I add the field “company” (and name it “inputLanguage”) which I misuse for this purpose. This field can also be selected in automation to control emails so this is why. Then I add the following code to set the value depending on which sites the user signs up
import wixLocation from ‘wix-location’;
$w.onReady(function () {
let language = wixLocation.url.split(‘/’)[3]
console.log("language: ", language)
//let language = (wixLocation.url).split('https://www.xxlreloading.com/de/')[1]
if (language == "de") {
console.log('de')
$w("#inputLanguage").value = "de-DE"
} else {
console.log("en")
$w("#inputLanguage").value = "en-US"
}
console.log('lan in dd', $w("#inputLanguage").value)
- Then I added a backend javascript file and named it events.js with the following code to update the language based on the value in the field “company”:
import { contacts } from ‘wix-crm-backend’;
import { getContactById } from ‘backend/updateUserLocale.jsw’
export async function wixCrm_onContactCreated(event) {
…
This did the trick for me. Happy to share the code for EUR 50 in return when it is being used. I had to pay an external developer myself.