Esempio n. 1
0
        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);
        }