microsoft / botframework-sdk

Bot Framework provides the most comprehensive experience for building conversation applications.
MIT License
7.43k stars 2.44k forks source link

[Question] Multi-lingual support for "Out of Box" Confirm prompt? #3275

Closed PrasadKosaraju closed 6 years ago

PrasadKosaraju commented 6 years ago

System Information

"I didn’t understand. Please answer ‘yes’ or ‘no’."

Code Example

builder.Prompts.confirm(session, 'Are you using your email address as your user name? ', ['yes', 'no']);

Here if the user enters something else other than yes or no. we get below message which is OOB. Need help how that can be mult-lingual "I didn’t understand. Please answer ‘yes’ or ‘no’."

stevengum commented 6 years ago

Does OOB in this context mean Out-of-bounds? I don't understand what OOB is.

How many languages are you planning on supporting? Are you just planning on setting it up globally to handle every possible language via translator and text analytics API?

PrasadKosaraju commented 6 years ago

OOB - Out of Box. Yes we want to setup globally for all languages eventually but not for pilot launch. i'm stuck how to translate some of them which is coming out of box which i specified below. This is comes from Bot framework and not handled by me

"I didn’t understand. Please answer ‘yes’ or ‘no’."

nwhitmont commented 6 years ago

OOB == default messaging text found in BotBuilder.js localization file.

For more information on localizing prompts see: https://docs.microsoft.com/en-us/bot-framework/nodejs/bot-builder-nodejs-localization#localize-prompts

The default localization system for the Bot Builder SDK is file-based and allows a bot to support multiple languages using JSON files stored on disk. By default, the localization system will search for the bot's prompts in the ./locale/<language_tag>/index.json file where is a valid IETF language tag representing the preferred locale for which to find prompts.

PrasadKosaraju commented 6 years ago

Sorry i didn't find this path in Azure Bot Service..

nwhitmont commented 6 years ago

@PrasadKosaraju You need to configure Continuous Integration for your bot code, and add the localization files yourself.

For more information, see: https://docs.microsoft.com/en-us/bot-framework/azure/azure-bot-service-continuous-integration

nwhitmont commented 6 years ago

relates to http://dailydotnettips.com/2017/07/18/setting-up-continuous-integration-for-azure-bot-services/

PrasadKosaraju commented 6 years ago

Tried with index.json for localization of confirm prompts..But still it's i enter yes or no it's not routing properly. Please let me know if i'm missing something. Here is the code

function (session) {
        //builder.Prompts.confirm(session, 'Did this re-solve the issue? ', ['yes', 'no']);
        //userLocale= session.preferredLocale();
        userLocale=session.conversationData.locale;
        var confirm_prompt=session.localizer.gettext(userLocale, "confirm_prompt");
            var confirm_yes=session.localizer.gettext(userLocale, "confirm_yes");
            var confirm_no=session.localizer.gettext(userLocale, "confirm_no");
            //console.log("confirm_prompt:::::"+confirm_prompt);
            builder.Prompts.confirm(session, confirm_prompt,[confirm_yes,confirm_no]);
    },
    function (session, results) {
session.send("You entered ::::::'%s'", results.response);

}