2

I'm currently tying to make a formflow in C# using bot framework, here's my code so far:

[Serializable] [Template(TemplateUsage.EnumSelectOne, "Selecciona un estadio: {||}", ChoiceStyle = ChoiceStyleOptions.PerLine)] public class StadiumInfoForm { [Prompt("Selecciona un estadio: ", ChoiceFormat = "{1}")] public StadiumOptions? estadio; public static IForm<StadiumInfoForm> BuildForm() { var form = new FormBuilder<StadiumInfoForm>() .Message($"¿De qué estadio te gustaría saber?") .AddRemainingFields(); PromptAttribute title = new PromptAttribute(); List<string> quitCommands = new List<string>(); quitCommands.Add("Salir"); quitCommands.Add("Cancelar"); quitCommands.Add("No"); quitCommands.Add("Quiero salir"); quitCommands.Add("Nada"); form.Configuration.Commands[FormCommand.Quit].Terms = quitCommands.ToArray(); return form.Build(); } } 

As you can see the form will be in spanish, the problem is that the prompt displayed at the top of the form always reads "Please select an estadio", I tried changing it following this documentation but to no avail, how can I change this attribute of the form to display something like "Seleccione un estadio por favor"

I'll upload more code if needed.

1
  • the problem is that the prompt displayed at the top of the form always reads "Please select an estadio" Does issue appear when you test your bot with emulator? Commented Jun 18, 2018 at 6:28

1 Answer 1

1

Maybe the template of the class "confusing" the FormFlow?

[Serializable] [Template(TemplateUsage.NavigationFormat, "{&}")] public class StadiumInfoForm { [Prompt("Seleccione un estadio por favor{||}", ChoiceFormat = "{1}")] public StadiumOptions? estadio; 

{&} is a pattern language

With only these changes it works for me

enter image description here

P.S. If you want to change the language of the entire FormFlow you can add activity.Locale = "es-ES"; in the Post method of your "MessagesController"

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.