T
Typebotβ€’13mo ago
William

multi-lingual bot

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?
15 Replies
Abdullah
Abdullahβ€’13mo ago
No description
No description
Abdullah
Abdullahβ€’13mo ago
here is the "[Function] Base Localization" typebot i jump into
Abdullah
Abdullahβ€’13mo ago
make sure to enable merge answers
Abdullah
Abdullahβ€’13mo ago
[Function] Base Localization contains default localization data as well as a default language
No description
No description
Abdullah
Abdullahβ€’13mo ago
however default language must be set in your main bot you are calling the "[Function] Base Localization" from.
No description
Abdullah
Abdullahβ€’13mo ago
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)
No description
William
WilliamOPβ€’13mo ago
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
Abdullah
Abdullahβ€’13mo ago
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
William
WilliamOPβ€’13mo ago
ok 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?
Abdullah
Abdullahβ€’13mo ago
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
iSP
iSPβ€’2w ago
@Abdullah did you ever try to pass the conversation then to a transcript? it seems that all this jumping from bot to bot stops the trajectory from being saved in the System.Transcript variable. Any ideas?
Abdullah
Abdullahβ€’2w ago
What do you mean?
iSP
iSPβ€’2w ago
@Abdullah Once creating the Localization dialogue to jump to, which holds the translations with keys and values, if one tries to catch the whole dialogue history in the system.transcript variable and checks the results, some of the dialogue strings are empty (at least for me). Something seems to be messed up maybe from merging answers. Here is an example: The dialogue shown returns the text based transcript on the left. Have you ever tried this and if so, do you have any idea on why its happening? Thanks! πŸ™Œ
No description
No description
Abdullah
Abdullahβ€’2w ago
I am no longer using typebot and have not been, not sure when system.transcript was introduced πŸ˜… you will have to debug this by checking where does the workflow lose the data
iSP
iSPβ€’2w ago
Oh well, thanks anyway for replying! Cheers πŸ‘‹

Did you find this page helpful?