Botframework-sdk: Localization of error messages works locally but not on Azure

Created on 6 Apr 2017  路  3Comments  路  Source: microsoft/botframework-sdk

I am developing a bot using Node.js. I try to replace the default error messages (e.g. "I didn't understand. Please try again." or "I didn't understand. Please choose an option from the list.") with German messages.

I have created a file BotBuilder.json in the newly created folder ./locale/de as described in the Docs. The file looks like this:

{
"default_text": "Das habe ich nicht verstanden. Bitte versuchen Sie es nochmal.",
"default_number": "Entschuldigung, aber ich glaube das ist keine Zahl. Bitte geben Sie eine Zahl ein.",
"default_confirm": "Das habe ich nicht verstanden. Bitte antworten Sie mit Ja oder Nein.",
"list_or": " oder ",
"list_or_more": ", oder ",
"confirm_yes": "Ja",
"confirm_no": "Nein",
"default_choice": "Das habe ich nicht verstanden. Bitte w盲hlen Sie eine Option aus der Liste.",
"default_time": "Entschuldigung, aber ich glaube das ist kein korrektes Datum oder Zeitangabe. Bitte geben Sie die Zeit in folgendem Format ein (MM/DD/YYYY HH:MM:SS).",
"default_file": "Ups, ich habe keine Datei bekommen. Bitte versuchen Sie es nochmal.",
"default_error": "Oje, irgendwas ist schiefgegangen. Versuchen wir es nochmal, vielleicht klappt es diesmal."
} 

This works in the emulator on my local machine where the German messages are shown. But it doesn't work when I upload it to Azure (neither in the Azure Development Chat or in Facebook or Skype). There the English messages are shown

I use session.preferredLocale('de'); to make sure that the Locale is set to German and I am uploading my code via continuous integration from Dropbox.

I have no idea what the problem could be. Is this a BotBuilder Bug or an Azure issue?

Most helpful comment

Yep, that seems to solve the problem. Thanks a lot!
Case closed :)

All 3 comments

Are you using the BotServiceConnector from botbuilder-azure? There is an open issue with localisation not working while using Azure Bot Service. You can also find the solution there.

In short, the solution is to set the LocalePath manually.

bot.set('localizerSettings', {
     botLocalePath: __dirname + "\\locale"
});

Yep, that seems to solve the problem. Thanks a lot!
Case closed :)

I'm closing this issue, since your problem has been solved with the workaround mentioned by @imicknl and this one will track the underlying issue until it is addressed.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jschristophe picture jschristophe  路  3Comments

RaoVenka picture RaoVenka  路  3Comments

somprabhsharma picture somprabhsharma  路  3Comments

hailiang-wang picture hailiang-wang  路  3Comments

peterbozso picture peterbozso  路  3Comments