botbuilder
Advanced tools
Comparing version 3.3.0 to 3.3.1
@@ -6,5 +6,3 @@ "use strict"; | ||
var DefaultLocalizer = (function () { | ||
function DefaultLocalizer() { | ||
} | ||
DefaultLocalizer.prototype.initialize = function (settings) { | ||
function DefaultLocalizer(settings) { | ||
if (settings === void 0) { settings = {}; } | ||
@@ -26,3 +24,3 @@ if (settings.botLocalePath) { | ||
} | ||
}; | ||
} | ||
DefaultLocalizer.prototype.defaultLocale = function (locale) { | ||
@@ -167,3 +165,5 @@ if (locale) { | ||
logger.debug("localizer::already loaded requested locale: %s", localeRequestKey); | ||
done(null); | ||
if (done) { | ||
done(null); | ||
} | ||
return; | ||
@@ -220,10 +220,9 @@ } | ||
], function (err, results) { | ||
if (err) { | ||
done(err); | ||
} | ||
else { | ||
if (!err) { | ||
DefaultLocalizer.localeRequests[localeRequestKey] = true; | ||
logger.debug("localizer::loaded requested locale: %s", localeRequestKey); | ||
done(); | ||
} | ||
if (done) { | ||
done(err); | ||
} | ||
}); | ||
@@ -230,0 +229,0 @@ }; |
@@ -72,3 +72,4 @@ "use strict"; | ||
if (!recognizeResult) { | ||
this.recognize({ message: session.message, dialogData: session.dialogData, activeDialog: true }, function (err, result) { | ||
var locale = session.preferredLocale(); | ||
this.recognize({ message: session.message, locale: locale, dialogData: session.dialogData, activeDialog: true }, function (err, result) { | ||
if (!err) { | ||
@@ -75,0 +76,0 @@ _this.invokeIntent(session, result); |
@@ -16,4 +16,3 @@ "use strict"; | ||
var utterance = context.message.text; | ||
var locale = context.message.textLocale || '*'; | ||
var model = this.models.hasOwnProperty(locale) ? this.models[locale] : this.models['*']; | ||
var model = this.models.hasOwnProperty(context.locale || '*') ? this.models[context.locale] : this.models['*']; | ||
if (model) { | ||
@@ -53,3 +52,3 @@ LuisRecognizer.recognize(utterance, model, function (err, intents, entities) { | ||
else { | ||
cb(new Error("LUIS model not found for locale '" + locale + "'."), null); | ||
cb(new Error("LUIS model not found for locale '" + context.locale + "'."), null); | ||
} | ||
@@ -56,0 +55,0 @@ } |
@@ -255,7 +255,7 @@ "use strict"; | ||
}; | ||
Prompts.text = function (session, prompt) { | ||
beginPrompt(session, { | ||
promptType: PromptType.text, | ||
prompt: prompt | ||
}); | ||
Prompts.text = function (session, prompt, options) { | ||
var args = options || {}; | ||
args.promptType = PromptType.text; | ||
args.prompt = prompt; | ||
beginPrompt(session, args); | ||
}; | ||
@@ -262,0 +262,0 @@ Prompts.number = function (session, prompt, options) { |
@@ -10,5 +10,5 @@ { | ||
"default_choice": "I didn't understand. Please choose an option from the list.", | ||
"default_time": "I didn't recognize the time you entered. Please try again.", | ||
"default_time": "I didn't recognize the time you entered. Please try again using a format of (MM/DD/YYYY HH:MM:SS).", | ||
"default_file": "I didn't receive a file. Please try again.", | ||
"default_error": "Oops. Something went wrong and we need to start over." | ||
} |
{ | ||
"default_text": "No se pudo reconocer su respuesta. Por favor vuelva a intentar.", | ||
"default_number": "No se pudo reconocer el texto como número. Vuelva a intentar sólo con números.", | ||
"default_confirm": "No se pudo reconocer la confirmación. Por favor responda con 'si' o 'no'.", | ||
"list_or": " o ", | ||
"list_or_more": ", o ", | ||
"confirm_yes": "si", | ||
"confirm_no": "no" | ||
"confirm_no": "no", | ||
"default_choice": "No se pudo reconocer su respuesta. Por favor seleccione una opción de la lista.", | ||
"default_time": "No se pudo reconocer el formato de la fecha. Por favor vuelva a intentar (MM/DD/YYYY HH:MM:SS).", | ||
"default_file": "No se pudo recibir el archivo. Por favor vuelva a intentar.", | ||
"default_error": "Oops. Ocurrió un problema. Por favor vuelva a intentar." | ||
} |
@@ -31,3 +31,3 @@ "use strict"; | ||
if (!options.localizer) { | ||
this.localizer = new dfLoc.DefaultLocalizer(); | ||
this.localizer = new dfLoc.DefaultLocalizer(options.localizerSettings); | ||
} | ||
@@ -37,3 +37,2 @@ else { | ||
} | ||
this.localizer.initialize(options.localizerSettings); | ||
if (typeof this.options.autoBatchDelay !== 'number') { | ||
@@ -476,3 +475,4 @@ this.options.autoBatchDelay = 250; | ||
var dialog = this.findDialog(cur.id); | ||
dialog.recognize({ message: this.message, dialogData: cur.state, activeDialog: true }, done); | ||
var locale = this.preferredLocale(); | ||
dialog.recognize({ message: this.message, locale: locale, dialogData: cur.state, activeDialog: true }, done); | ||
} | ||
@@ -479,0 +479,0 @@ else { |
@@ -5,3 +5,3 @@ { | ||
"description": "Bot Builder is a dialog system for building rich bots on virtually any platform.", | ||
"version": "3.3.0", | ||
"version": "3.3.1", | ||
"license": "MIT", | ||
@@ -8,0 +8,0 @@ "keywords": [ |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
333245
49
7326