https://discord.gg/botpress logo
#👀feature-requests
Please make a langauge change card.
# 👀feature-requests
c

cool-policeman-94412

10/16/2023, 7:37 AM
The current translation mechanism makes it impossible to write a proper one as ALL outgoing information is translated. An translation card could: * Have multiple selectable inerfaces (button, text) * accept list of languages. Here is the trick, though - the OUTGOING selection of languages would NOT be translated, offering every langauge IN THE LANGUAGE. Example? Right now if the user is talking english and I want to offer him english (which we could actually suppress), german and spanish, he would see: * English * German * Spanish That is - bad for users not speaking enlish. With a card, he would see: * English * Deutsch * Espanol Basically every language IN THE LANGAUGE. This is impossible to do now with coding.
n

narrow-agent-91470

10/16/2023, 4:54 PM
c

cool-policeman-94412

10/16/2023, 6:55 PM
Dooes not work. See, unless it is done IN THE SYSTEM - then the language output gets translated into the current language. Consider reading my proposal - it is about NOT translating this particular part so that the langauge selection is shown in native langauge.
c

crooked-van-25152

10/16/2023, 6:58 PM
thank you for taking the time to write this feature request @cool-policeman-94412
c

cool-policeman-94412

10/16/2023, 9:03 PM
I think it is valuable. Asking fo another langauge and getting a list you may not recognize your langauge in because it swritten in teh wrong language - not helping 😉
n

narrow-agent-91470

10/16/2023, 9:14 PM
I got you, make sense what you say.
e

early-train-33247

11/03/2023, 1:32 PM
Hey @cool-policeman-94412, I think you can use an AI Task for this! Your language choices would have to be in an array variable, with the following format:
Copy code
js
[{
 label: "English",
 value: "en"
}, {
 label: "Spanish",
 value: "es",
}, {
 label: "Portuguese",
 value: "pt"
}]
You can build this using a Code card
Now you will pass that variable to an AI Task with the instructions:
Copy code
Consider this list of language options to be presented to a user.
You should output an array in the same format but with each label translated to its respective language
And the input:
list: @workflow.languageOptions
The output will be:
Copy code
json
[
  {
    "label": "English",
    "value": "en"
  },
  {
    "label": "Español",
    "value": "es"
  },
  {
    "label": "中文",
    "value": "zh"
  }
]
Then you pass this variable as custom choices in your Capture. Store the selected language in a variable and use it in the
Set User Language
card
@cool-policeman-94412 Let me know if that helps!
j

jolly-policeman-82775

11/03/2023, 3:03 PM
why you ping me ?
why deleted me message ?
e

early-train-33247

11/03/2023, 6:29 PM
Because that's what you asked about ahah. And because it was in the middle of the steps 😅