ushahidi / ussd-engine

Session engine for interaction with end users via a USSD provider
GNU Affero General Public License v3.0
7 stars 8 forks source link

Customize USSD dialogue text #111

Closed tuxpiper closed 2 years ago

tuxpiper commented 2 years ago

Add a configuration setting to settings.json , in order to tweak the survey selection dialog. This should be configurable per language, i.e.:

"parting_message": {
  "en": "Bye, so long!",
  "en-gb": "Cheerio!",
  "en-us": "I'll be back",
  "es": "Chau!"
}

but also the survey selection messages, i.e.

"messages": {
  "survey_question": {
    "en": "What would you like for breakfast?",
    "en-gb": "What would you like for breakfast, dear?",
    "en-us": "What would you like for breakfast, sweetie?",
    "es": "Qué quieres comer?"
  }
}
tuxpiper commented 2 years ago

Ended adopting a slightly different approach, where any string in the resources files can be overloaded. A single file lang_strings.json can take care of it:

{
  "en": {
    "conversation.selectSurvey": "Choose your adventure",
    "conversation.thanksForSubmitting": "Good job!"
  },
  "es": {
    "conversation.selectSurvey": "Elija su aventura",
    "conversation.thanksForSubmitting": "¡Buen trabajo!"
  }    
}