bots


How can I use PromptDialog.Choice while allowing the user to type the options without worrying about accented letters?


How can I use PromptDialog.Choice while allowing the user to type the options without worrying about accented letters?
Given the following prompt to the user:
List<string> promptValues = new List<string> { "Sim", "Não" };
PromptDialog.Choice<string>(context,
AfterPrompt,
promptValues,
"Digite 'Sim' ou 'Não'",
"Opção inválida, por favor tente novamente.");
How can I allow the user to input "Nao" or "Não" without the prompt considering "Nao" as a wrong answer?
I can't use PromptDialog.Confirm because I need the dialogs to happen in Portuguese, and as far as I know I can't localize PromptDialog.Choice.
Also I want to know how can I ignore accents even with other kinds of prompt, not only Yes or No prompts.
Is there a way to do this?
I believe you might be able to localize the PromptConfirm options if you change the culture of the bot like:
Thread.CurrentThread.CurrentCulture = CultureInfo.GetCultureInfo("de-DE");
because the options are being retrieved from a resource file (see this)
Now, it seems that the Portuguese resource is not implemented yet, which from my point of view it could be something great to contribute if you want to.
On the other hand, if you want to have some custom logic in the PromptChoice, you can always inherit from it and override the TryParse method to add your checks. Here is an example of a custom PromptChoice.

Related Links

How can I integrate my Bot (created with the Bot Framework) with Spark?
Microsoft Bot says “The process cannot access the file because it is being used by another process.”
When should we use all three (trait, free-text and keywords) search strategies in a user-defined entity?
alternative to wit.ai merge since it is deprecated now
my telegram bot keeps sending messages endlessly
Telegram: don't search my bot to start conversation
How to add MS bot to slack?
How to get the last executed command in a Telegram bot?
How can i customize answer of Bot Framework Help Command?
How can I identify the particular attachments when I click on a button in cards?
Accessing facebook user id for microsoft bot framework
Wit.ai Dynamic quick replies and random responses? How
I'm trying to implement a quote system in mIRC for my Twitch bot, reading from the text file works, but adding doesn't
How to set Slack bot presence “online” when using Events API
how to save the data using state clinet in bots
Connecting LUIS dialog to form dialog and mapping builtin fields

Categories

HOME
php
hpoo
powerbi
mc
vagrant
bots
scroll
dafny
plaid
semantic-web
dji-sdk
onvif
responsive-design
sharepoint-online
heuristics
migrate
alljoyn
phpstorm-2017.1
office-ui-fabric
gmp
tfsbuild
parceler
azure-machine-learning
workday
bsd
coreldraw
kamailio
quantitative-finance
jstree
hdmi
android-cardview
acrobat
ccavenue
vcenter
windows2012
advanced-filter
ms-media-foundation
markov-chains
autoencoder
keyboard-layout
bluemixtools
telephonymanager
assemblies
grails3.2.0
dagger
jqgrid-asp.net
apache-toree
rightnow-crm
dredd
qvtkwidget
rm
emacs25
pecl
instafeedjs
adobe-reader
controllers
ipywidgets
multi-touch
visual-studio-monaco
jenkins-workflow
dpkg
android-sdcard
qpixmap
apache-pig-grunt
frame-grab
fdt
vimperator
preferenceactivity
ui4j
textpattern
asp.net-web-api-helppages
android-studio-import
pythonxy
360-degrees
replicaset
swagger-maven-plugin
ipod
erlog
ocmockito
quercus
uno
iodocs
git-reset
forceclose
sqlbindparameter
meteor-collections
air-native-extension
webaii
cpu-time
lync-2010
django-settings
visual-c++-2005
hyphen
rautomation
iirf
mp4parser
.net-remoting
jacob
chartfx
delphi-xe4
donut-chart
cyrillic
system-requirements
clrprofiler
live-wallpaper
zotonic
kobold2d
uipangesturerecognizer
dynamic-c
representation
tablet-pc
servlet-container
django-pagination
j2mepolish
ntruencrypt
error-detection
synthesizer

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App