Share feedback, ideas and get community help

Updated 4 months ago

multi-lingual bot

At a glance

The community members are discussing the best strategy to create a bot that works in 3 languages, where the text in the bubbles and inputs needs to be displayed in the user's selected language. The main points are:

- The community members suggest using a "[Function] Base Localization" typebot that contains default localization data and a default language, but the default language must be set in the main bot that calls the "[Function] Base Localization".

- They recommend setting the localization in "specificLocalization" rather than "common localization" in the "[Function] Base Localization" typebot.

- The community members provide an example of how the labels can be structured, with the language-specific text stored in a JSON object. They discuss the most efficient way to access these labels, suggesting the use of a specific key format (e.g., "ASK_NAME_INPUT") to make it easier to parse the JSON object.

There is no explicitly marked answer in the comments, but the community members provide suggestions and guidance on how to approach the problem.

I need to have a bot which works in 3 languages. All the flows are the same only the Bubbles and Inputs need to have text displayed as per the selected language. The user selects his preferred language in the 1st step. What is the best strategy without having to implement 3 bots?
A
W
17 comments
here is the "[Function] Base Localization" typebot i jump into
make sure to enable merge answers
[Function] Base Localization contains default localization data as well as a default language
Attachments
image.png
image.png
however default language must be set in your main bot you are calling the "[Function] Base Localization" from.
Attachment
image.png
you need to set your localization in specificLocalization rather than common localization in "[Function] Base Localization" (i do it because i have a use case that requires me to do it)
Attachment
image.png
thanks for your response, will check and get back
my typebot labels are as follows (sharing a small subset):
{
"lables": {
"what is your name": {
"en": "what is your name",
"de": "wie heißt du",
"fr": "quel est ton nom"
},
"send": {
"en": "send",
"de": "schicken",
"fr": "envoyer"
},
"what is your email": {
"en": "what is your email",
"de": "was ist Ihre E-Mail",
"fr": "quel est ton email"
}
}
}

And the selected language - this i get from the user as the 1st step, so the user selects en, de or fr - one of them
i want to know what is the most efficient way to access the labels on the buttons/inputs/answers etc - ideally i would not want the whole labels variable string to be part of each user
any help and suggestions would be appreciated
This will require you to change how the keys are mentioned and how function parses the key
If you are not a developer it may be hard to do it, also you need to use a specific format for keys example what is your name should be keyed as ASK_NAME_INPUT
Then you can use the key

LABELS.ASK_NAME_INPUT

Then in function separate key by . and then go down the tree of json objects
Or use the bot as is and change the way you label your data
and the labels json, that will be a copy in each user session right? any way to keep that globally, so that we have only 1 copy?
specificLocalization is global since its saved in a variable
And its parsed by the other typebot
Remember data is transferred between typebot if u enable merge answers
Add a reply
Sign up and join the conversation on Discord