private string DetermineCulture(Activity activity, FindChoicesOptions opt = null) { var culture = MapToNearestLanguage(activity.Locale ?? opt?.Locale ?? DefaultLocale ?? English.Locale); if (string.IsNullOrEmpty(culture) || !_choiceDefaults.ContainsKey(culture)) { culture = English.Locale; } return(culture); }
private string DetermineCulture(DialogContext dc, FindChoicesOptions opt = null) { var culture = PromptCultureModels.MapToNearestLanguage(dc.Context.Activity.Locale ?? opt?.Locale ?? DefaultLocale?.GetValue(dc.State)); if (string.IsNullOrEmpty(culture) || !DefaultChoiceOptions.ContainsKey(culture)) { culture = English; } return(culture); }
private string DetermineCulture(DialogContext dc, FindChoicesOptions opt = null) { // Note: opt.Locale and Default locale will be considered for deprecation as part of 4.13. var candidateLocale = dc.GetLocale() ?? opt?.Locale ?? DefaultLocale?.GetValue(dc.State); var culture = PromptCultureModels.MapToNearestLanguage(candidateLocale); if (string.IsNullOrEmpty(culture) || !DefaultChoiceOptions.ContainsKey(culture)) { culture = English; } return(culture); }