aws-samples / aws-lex-web-ui

Sample Amazon Lex chat bot web interface
Other
732 stars 466 forks source link

Multi-language support for lex-web-ui live chat #508

Open gaffnelo opened 1 year ago

gaffnelo commented 1 year ago

Allow translation of default live chat prompts

atjohns commented 1 year ago

Have you looked at QnABot as a potential solution? This functionality comes out of the box with QnABot. You could also look at their Github repo if you want to implement your own version of this functionality.

bobpskier commented 1 year ago

@atjohns I believe the live chat prompts are configured in lex-web-ui config and not sent into the bot for translation. It might be good to allow these messages to be specified per locale.

Presently the config contains.

"promptForNameMessage": "Before starting a live chat, please tell me your name?",
"waitingForAgentMessage": "Thanks for waiting. An agent will be with you when available.",
"waitingForAgentMessageIntervalSeconds": "60",
"agentJoinedMessage": "{Agent} has joined.",
"agentLeftMessage": "{Agent} has left.",
"chatEndedMessage": "Chat ended.",

As an example, something like the following might be sufficient.

"promptForNameMessage":  {
    "default": "Before starting a live chat, please tell me your name?",
    "en_US":  "",
    "es_US":  "",
    "fr_CA": ""
 }

The values specified in the CF template would fill in the default. Admins could configure additional values in the lex-web-ui-loader-config.json. Then lex-web-ui would pick either the default value or the entry for the currently selected locale if one was available.

The most challenging aspect would be to preserve the additional configured values during an CF stack update but it should be doable.