acuminous/yadda — pull request #41 by kjelloe (2013-11-12 10:47:43+00:00)
Title: Added proper Norwegian localization keyword aliases for GWT

Sorry. I obviously didn't test the Norwegian support for both Given-When-Then and Gitt-Når-Så extensively enough. With the current 0.8.4 only GWT works, due to the signature-localisation-lookup in Language.js This is what we Norwegians get for mixing English and Norwegian in code when doing BDD...

I've added the Norwegian Gitt-Når-Så as property getters as to make them as aliases. If this seems like to much functionality in the vocabulary dictionary, it can be done as a function instead. For example:

// Aliasing Norwegian verbs for given-when-then
var vocabulary = new function() {
this.feature = '(?:[Ee]genskap)';
this.scenario = '(?:[Ss]cenario)';
this.pending = 'Avventer';
this.given = this.gitt = '(?:[Gg]itt|[Mm]ed|[Oo]g|[Mm]en|[Uu]nntatt)';
this.when = this.når = '(?:[Nn]år|[Oo]g|[Mm]en)';
this.then = this.så = '(?:[Ss]å|[Ff]forvent|[Oo]g|[Mm]en)';
this._steps = ['given', 'when', 'then', 'gitt', 'når', 'så'];
};