botframework-sdk icon indicating copy to clipboard operation
botframework-sdk copied to clipboard

[.NET SDK] Azure Functions Bot won't localize built-in messages/texts

Open dogfuntom opened this issue 8 years ago • 3 comments

Bot Info

  • SDK Platform: .NET
  • SDK Version: 3.14.1.1
  • Active Channels: Telegram, Emulator
  • Deployment Environment: Azure Functions Bot, Emulator

Issue Description

Even if locale is forced explicitly and emulator shows that all incoming and outcoming messages has that locale, the bot still uses English texts ("yes", "I didn't understand. Say something in reply.", etc.) instead of localized texts.

(But if the same is repeated in Azure App Service Bot, then all such texts are localized correctly.)

Code Example

if (activity != null)
{
    activity.Locale = "ru-RU";
    ...
}

Reproduction Steps

  1. Create an Azure Functions Bot from basic template.
  2. (optional) Forcibly set locale as in code example above.
  3. Launch in emulator with needed locale. Observe English texts despite locale is correct in details in both incoming and outcoming messages.
  4. (optional) Observe the same behaviour in all possible environments: Visual Studio + Emulator, Azure + Emulator, and in actual channel (I tried Telegram).

Expected Behavior

Localized texts ("yes" → "да", etc.). Note that unlike Functions Bot, App Service Bot shows localized built-in text in the identical circumstances.

Actual Results

English texts despite locale is correct and supported (e.g. by App Service Bot). image 1

dogfuntom avatar Mar 30 '18 00:03 dogfuntom

Hi JasonSowers, did you find any information about this because i am facing the similar problem.

gopal300 avatar Apr 23 '18 08:04 gopal300

Sorry for the delay this fell off my radar and I had been out of the country.

In your image, you are using the emulator. If you set the locale in the emulator itself it will show up with the yes/no options in Russian as you need. Are you seeing this in other channels as well?

image

This was simply using this code:

    public virtual async Task MessageReceivedAsync(IDialogContext context, IAwaitable<IMessageActivity> argument)
    {
        PromptDialog.Confirm(context, afterPrompt, "Do you like nachos");
    }

    public async Task afterPrompt(IDialogContext context, IAwaitable<bool> argument)
    {
        bool isCorrect = await argument;
        if (isCorrect)
        {
            await context.PostAsync("some text");
        }
        else
        {
            await context.PostAsync("some text 2");
        }
    }

JasonSowers avatar Jun 27 '18 17:06 JasonSowers

Going to assume this is resolved now, if you have any other issues please open a new issue.

JasonSowers avatar Jul 05 '18 20:07 JasonSowers