praekelt/go-ndoh — pull request #82 by gsvr (2014-08-07 12:09:45+00:00)
Title: Make language restart a Promise

Something like:
```
set_language: function(user, contact) {
if (contact.extra.language_choice !== null) {
return user.set_lang(contact.extra.language_choice);
} else {
return Q();
}
}

self.states.add('question_1_friendliness', function(name) {
go.utils.set_language(self.im.user, self.contact)
.then(function(){
return new ChoiceState(name, {
question: $('Welcome. When you signed up, were staff at the facility friendly & helpful?'),

choices: [
new Choice('very-satisfied', $('Very Satisfied')),
new Choice('satisfied', $('Satisfied')),
new Choice('not-satisfied', $('Not Satisfied')),
new Choice('very-unsatisfied', $('Very unsatisfied'))
],

next: 'question_2_waiting_times_feel'
});
});
});

```