Changing language
# 🤝help
w
Hi guys, My bot is change languages mid answer. I already activated translation bot, and set the language, but it doesnt work. Does someone know how to fix it? https://cdn.discordapp.com/attachments/1240726709310066758/1240726709460799618/image.png?ex=66479c4b&is=66464acb&hm=c6364587d2f0ae9413f6615d73c9b6d98aeef90aabe70a4465307150451d006b&
c
Hi Victor, is this happening sporadically or does it occur at a specific flow in the conversation ? What you could do is use the following command to force the translator agent to a language of your choosing:
Copy code
js
user.TranslatorAgent.language = "en";
n
I disable the automatic language recognition at every step and just set the language at the beginning of the conversation in an if statement, that could help
w
Hi Remo, It happens sporadically. In any flow of the conversation I'm using set user language card. Is user.TranslatorAgent.language better than the card? Should I put it in every workflow or just the main one where the conversation start is enough? https://cdn.discordapp.com/attachments/1240726709310066758/1241026059365908570/image.png?ex=6648b315&is=66476195&hm=3950e6b9abff23982d0a3c79c8b3ee3e5805badeb6c8106c41bd643847aee3b8&
Thats what I'm doing now 🥲
just to say, I want it to be in portuguese
c
I don’t think it is particularly better as it probably uses the same code under the hood but it could solve this issue. You would only set it at the beginning of your main flow 👍
w
Okay. I will run a few tests to see if happens again. Thanks for your help
@cold-jewelry-54343 It didn't work
c
@wooden-parrot-76912 Can you follow what I suggested in here ? #1227882704683667456
w
OK, @cold-jewelry-54343 So lets see if I got it right First I use this on a execute code card to set it to english user.TranslatorAgent.language = "en"; Then I set the language (in the same execute code card) that I want the bot to respond, which is portuguese: user.TranslatorAgent.language = "pt-BR"; Then I send my answer YOUR KB ANSWER HERE // After the anwer, I execute this to turn it to english again: user.TranslatorAgent.language = "en". Is that correct?
c
"Then I set the language (in the same execute code card) that I want the bot to respond, which is portuguese: user.TranslatorAgent.language = "pt-BR"; " No that is incorrect. You want to place your translated text inbetween the 2 code cards, let me explain: - the user.TranslatorAgent.language instructs the bot to only use this language unless its overridden. We just want to temporarily override our default language, this so we can display a message in a new language without the TranslatorAgent auto-detecting which can cause issues. You want to Enable the Translator Agent but disable the "Detect INitial User Language". Let me know if this makes sense! https://cdn.discordapp.com/attachments/1240726709310066758/1241045087094575124/brave_VCFdbaPkal.png?ex=6648c4ce&is=6647734e&hm=172c2ef10af36f6ae2cdd221034975f55696cdb5215a85b878daadd8ef24d557&
w
Ok, I'll try This is how my workflow is looking like now:
The first set user language is to set the language pt-BR. The second one returns it to english
@cold-jewelry-54343 Could I use a hook to do it? Like, before and after incoming message
c
Hey Victor, Did your translation work ? I am actually not using Hooks as of yet but maybe one of the other Botbassadors knows ? @User
f
Hey there👋 Could one of you make a quick summary of the conversation, and what the issue is?
c
to bypass a translation issue where translated text auto-translates to the OG language (Translating agent) we can can force set the language to a specific language like in the above screenshot. @wooden-parrot-76912 wants to know if we can use a Hook to automate this process with a Hook.
f
Thank you! I believe we could do that with the "After Incomming Message" hook.
w
Now, the bot is answering in english, ignoring my translation hook and even the translation card I've tried some things and none of them worked I opened another post here with the issue
#1242151160492593302 this is it
@fresh-fireman-491
5 Views