diff --git a/gherkin-languages.json b/gherkin-languages.json new file mode 100644 index 0000000..913cfac --- /dev/null +++ b/gherkin-languages.json @@ -0,0 +1,3514 @@ +{ + "af": { + "and": [ + "* ", + "En " + ], + "background": [ + "Agtergrond" + ], + "but": [ + "* ", + "Maar " + ], + "examples": [ + "Voorbeelde" + ], + "feature": [ + "Funksie", + "Besigheid Behoefte", + "Vermoë" + ], + "given": [ + "* ", + "Gegewe " + ], + "name": "Afrikaans", + "native": "Afrikaans", + "rule": [ + "Rule" + ], + "scenario": [ + "Voorbeeld", + "Situasie" + ], + "scenarioOutline": [ + "Situasie Uiteensetting" + ], + "then": [ + "* ", + "Dan " + ], + "when": [ + "* ", + "Wanneer " + ] + }, + "am": { + "and": [ + "* ", + "Եվ " + ], + "background": [ + "Կոնտեքստ" + ], + "but": [ + "* ", + "Բայց " + ], + "examples": [ + "Օրինակներ" + ], + "feature": [ + "Ֆունկցիոնալություն", + "Հատկություն" + ], + "given": [ + "* ", + "Դիցուք " + ], + "name": "Armenian", + "native": "հայերեն", + "rule": [ + "Rule" + ], + "scenario": [ + "Օրինակ", + "Սցենար" + ], + "scenarioOutline": [ + "Սցենարի կառուցվացքը" + ], + "then": [ + "* ", + "Ապա " + ], + "when": [ + "* ", + "Եթե ", + "Երբ " + ] + }, + "an": { + "and": [ + "* ", + "Y ", + "E " + ], + "background": [ + "Antecedents" + ], + "but": [ + "* ", + "Pero " + ], + "examples": [ + "Eixemplos" + ], + "feature": [ + "Caracteristica" + ], + "given": [ + "* ", + "Dau ", + "Dada ", + "Daus ", + "Dadas " + ], + "name": "Aragonese", + "native": "Aragonés", + "rule": [ + "Rule" + ], + "scenario": [ + "Eixemplo", + "Caso" + ], + "scenarioOutline": [ + "Esquema del caso" + ], + "then": [ + "* ", + "Alavez ", + "Allora ", + "Antonces " + ], + "when": [ + "* ", + "Cuan " + ] + }, + "ar": { + "and": [ + "* ", + "و " + ], + "background": [ + "الخلفية" + ], + "but": [ + "* ", + "لكن " + ], + "examples": [ + "امثلة" + ], + "feature": [ + "خاصية" + ], + "given": [ + "* ", + "بفرض " + ], + "name": "Arabic", + "native": "العربية", + "rule": [ + "Rule" + ], + "scenario": [ + "مثال", + "سيناريو" + ], + "scenarioOutline": [ + "سيناريو مخطط" + ], + "then": [ + "* ", + "اذاً ", + "ثم " + ], + "when": [ + "* ", + "متى ", + "عندما " + ] + }, + "ast": { + "and": [ + "* ", + "Y ", + "Ya " + ], + "background": [ + "Antecedentes" + ], + "but": [ + "* ", + "Peru " + ], + "examples": [ + "Exemplos" + ], + "feature": [ + "Carauterística" + ], + "given": [ + "* ", + "Dáu ", + "Dada ", + "Daos ", + "Daes " + ], + "name": "Asturian", + "native": "asturianu", + "rule": [ + "Rule" + ], + "scenario": [ + "Exemplo", + "Casu" + ], + "scenarioOutline": [ + "Esbozu del casu" + ], + "then": [ + "* ", + "Entós " + ], + "when": [ + "* ", + "Cuando " + ] + }, + "az": { + "and": [ + "* ", + "Və ", + "Həm " + ], + "background": [ + "Keçmiş", + "Kontekst" + ], + "but": [ + "* ", + "Amma ", + "Ancaq " + ], + "examples": [ + "Nümunələr" + ], + "feature": [ + "Özəllik" + ], + "given": [ + "* ", + "Tutaq ki ", + "Verilir " + ], + "name": "Azerbaijani", + "native": "Azərbaycanca", + "rule": [ + "Rule" + ], + "scenario": [ + "Nümunə", + "Ssenari" + ], + "scenarioOutline": [ + "Ssenarinin strukturu" + ], + "then": [ + "* ", + "O halda " + ], + "when": [ + "* ", + "Əgər ", + "Nə vaxt ki " + ] + }, + "bg": { + "and": [ + "* ", + "И " + ], + "background": [ + "Предистория" + ], + "but": [ + "* ", + "Но " + ], + "examples": [ + "Примери" + ], + "feature": [ + "Функционалност" + ], + "given": [ + "* ", + "Дадено " + ], + "name": "Bulgarian", + "native": "български", + "rule": [ + "Rule" + ], + "scenario": [ + "Пример", + "Сценарий" + ], + "scenarioOutline": [ + "Рамка на сценарий" + ], + "then": [ + "* ", + "То " + ], + "when": [ + "* ", + "Когато " + ] + }, + "bm": { + "and": [ + "* ", + "Dan " + ], + "background": [ + "Latar Belakang" + ], + "but": [ + "* ", + "Tetapi ", + "Tapi " + ], + "examples": [ + "Contoh" + ], + "feature": [ + "Fungsi" + ], + "given": [ + "* ", + "Diberi ", + "Bagi " + ], + "name": "Malay", + "native": "Bahasa Melayu", + "rule": [ + "Rule" + ], + "scenario": [ + "Senario", + "Situasi", + "Keadaan" + ], + "scenarioOutline": [ + "Kerangka Senario", + "Kerangka Situasi", + "Kerangka Keadaan", + "Garis Panduan Senario" + ], + "then": [ + "* ", + "Maka ", + "Kemudian " + ], + "when": [ + "* ", + "Apabila " + ] + }, + "bs": { + "and": [ + "* ", + "I ", + "A " + ], + "background": [ + "Pozadina" + ], + "but": [ + "* ", + "Ali " + ], + "examples": [ + "Primjeri" + ], + "feature": [ + "Karakteristika" + ], + "given": [ + "* ", + "Dato " + ], + "name": "Bosnian", + "native": "Bosanski", + "rule": [ + "Rule" + ], + "scenario": [ + "Primjer", + "Scenariju", + "Scenario" + ], + "scenarioOutline": [ + "Scenariju-obris", + "Scenario-outline" + ], + "then": [ + "* ", + "Zatim " + ], + "when": [ + "* ", + "Kada " + ] + }, + "ca": { + "and": [ + "* ", + "I " + ], + "background": [ + "Rerefons", + "Antecedents" + ], + "but": [ + "* ", + "Però " + ], + "examples": [ + "Exemples" + ], + "feature": [ + "Característica", + "Funcionalitat" + ], + "given": [ + "* ", + "Donat ", + "Donada ", + "Atès ", + "Atesa " + ], + "name": "Catalan", + "native": "català", + "rule": [ + "Rule" + ], + "scenario": [ + "Exemple", + "Escenari" + ], + "scenarioOutline": [ + "Esquema de l'escenari" + ], + "then": [ + "* ", + "Aleshores ", + "Cal " + ], + "when": [ + "* ", + "Quan " + ] + }, + "cs": { + "and": [ + "* ", + "A také ", + "A " + ], + "background": [ + "Pozadí", + "Kontext" + ], + "but": [ + "* ", + "Ale " + ], + "examples": [ + "Příklady" + ], + "feature": [ + "Požadavek" + ], + "given": [ + "* ", + "Pokud ", + "Za předpokladu " + ], + "name": "Czech", + "native": "Česky", + "rule": [ + "Rule" + ], + "scenario": [ + "Příklad", + "Scénář" + ], + "scenarioOutline": [ + "Náčrt Scénáře", + "Osnova scénáře" + ], + "then": [ + "* ", + "Pak " + ], + "when": [ + "* ", + "Když " + ] + }, + "cy-GB": { + "and": [ + "* ", + "A " + ], + "background": [ + "Cefndir" + ], + "but": [ + "* ", + "Ond " + ], + "examples": [ + "Enghreifftiau" + ], + "feature": [ + "Arwedd" + ], + "given": [ + "* ", + "Anrhegedig a " + ], + "name": "Welsh", + "native": "Cymraeg", + "rule": [ + "Rule" + ], + "scenario": [ + "Enghraifft", + "Scenario" + ], + "scenarioOutline": [ + "Scenario Amlinellol" + ], + "then": [ + "* ", + "Yna " + ], + "when": [ + "* ", + "Pryd " + ] + }, + "da": { + "and": [ + "* ", + "Og " + ], + "background": [ + "Baggrund" + ], + "but": [ + "* ", + "Men " + ], + "examples": [ + "Eksempler" + ], + "feature": [ + "Egenskab" + ], + "given": [ + "* ", + "Givet " + ], + "name": "Danish", + "native": "dansk", + "rule": [ + "Rule" + ], + "scenario": [ + "Eksempel", + "Scenarie" + ], + "scenarioOutline": [ + "Abstrakt Scenario" + ], + "then": [ + "* ", + "Så " + ], + "when": [ + "* ", + "Når " + ] + }, + "de": { + "and": [ + "* ", + "Und " + ], + "background": [ + "Grundlage" + ], + "but": [ + "* ", + "Aber " + ], + "examples": [ + "Beispiele" + ], + "feature": [ + "Funktionalität" + ], + "given": [ + "* ", + "Angenommen ", + "Gegeben sei ", + "Gegeben seien " + ], + "name": "German", + "native": "Deutsch", + "rule": [ + "Rule" + ], + "scenario": [ + "Beispiel", + "Szenario" + ], + "scenarioOutline": [ + "Szenariogrundriss" + ], + "then": [ + "* ", + "Dann " + ], + "when": [ + "* ", + "Wenn " + ] + }, + "el": { + "and": [ + "* ", + "Και " + ], + "background": [ + "Υπόβαθρο" + ], + "but": [ + "* ", + "Αλλά " + ], + "examples": [ + "Παραδείγματα", + "Σενάρια" + ], + "feature": [ + "Δυνατότητα", + "Λειτουργία" + ], + "given": [ + "* ", + "Δεδομένου " + ], + "name": "Greek", + "native": "Ελληνικά", + "rule": [ + "Rule" + ], + "scenario": [ + "Παράδειγμα", + "Σενάριο" + ], + "scenarioOutline": [ + "Περιγραφή Σεναρίου", + "Περίγραμμα Σεναρίου" + ], + "then": [ + "* ", + "Τότε " + ], + "when": [ + "* ", + "Όταν " + ] + }, + "em": { + "and": [ + "* ", + "😂" + ], + "background": [ + "💤" + ], + "but": [ + "* ", + "😔" + ], + "examples": [ + "📓" + ], + "feature": [ + "📚" + ], + "given": [ + "* ", + "😐" + ], + "name": "Emoji", + "native": "😀", + "rule": [ + "Rule" + ], + "scenario": [ + "🥒", + "📕" + ], + "scenarioOutline": [ + "📖" + ], + "then": [ + "* ", + "🙏" + ], + "when": [ + "* ", + "🎬" + ] + }, + "en": { + "and": [ + "* ", + "And " + ], + "background": [ + "Background" + ], + "but": [ + "* ", + "But " + ], + "examples": [ + "Examples", + "Scenarios" + ], + "feature": [ + "Feature", + "Business Need", + "Ability" + ], + "given": [ + "* ", + "Given " + ], + "name": "English", + "native": "English", + "rule": [ + "Rule" + ], + "scenario": [ + "Example", + "Scenario" + ], + "scenarioOutline": [ + "Scenario Outline", + "Scenario Template" + ], + "then": [ + "* ", + "Then " + ], + "when": [ + "* ", + "When " + ] + }, + "en-Scouse": { + "and": [ + "* ", + "An " + ], + "background": [ + "Dis is what went down" + ], + "but": [ + "* ", + "Buh " + ], + "examples": [ + "Examples" + ], + "feature": [ + "Feature" + ], + "given": [ + "* ", + "Givun ", + "Youse know when youse got " + ], + "name": "Scouse", + "native": "Scouse", + "rule": [ + "Rule" + ], + "scenario": [ + "The thing of it is" + ], + "scenarioOutline": [ + "Wharrimean is" + ], + "then": [ + "* ", + "Dun ", + "Den youse gotta " + ], + "when": [ + "* ", + "Wun ", + "Youse know like when " + ] + }, + "en-au": { + "and": [ + "* ", + "Too right " + ], + "background": [ + "First off" + ], + "but": [ + "* ", + "Yeah nah " + ], + "examples": [ + "You'll wanna" + ], + "feature": [ + "Pretty much" + ], + "given": [ + "* ", + "Y'know " + ], + "name": "Australian", + "native": "Australian", + "rule": [ + "Rule" + ], + "scenario": [ + "Awww, look mate" + ], + "scenarioOutline": [ + "Reckon it's like" + ], + "then": [ + "* ", + "But at the end of the day I reckon " + ], + "when": [ + "* ", + "It's just unbelievable " + ] + }, + "en-lol": { + "and": [ + "* ", + "AN " + ], + "background": [ + "B4" + ], + "but": [ + "* ", + "BUT " + ], + "examples": [ + "EXAMPLZ" + ], + "feature": [ + "OH HAI" + ], + "given": [ + "* ", + "I CAN HAZ " + ], + "name": "LOLCAT", + "native": "LOLCAT", + "rule": [ + "Rule" + ], + "scenario": [ + "MISHUN" + ], + "scenarioOutline": [ + "MISHUN SRSLY" + ], + "then": [ + "* ", + "DEN " + ], + "when": [ + "* ", + "WEN " + ] + }, + "en-old": { + "and": [ + "* ", + "Ond ", + "7 " + ], + "background": [ + "Aer", + "Ær" + ], + "but": [ + "* ", + "Ac " + ], + "examples": [ + "Se the", + "Se þe", + "Se ðe" + ], + "feature": [ + "Hwaet", + "Hwæt" + ], + "given": [ + "* ", + "Thurh ", + "Þurh ", + "Ðurh " + ], + "name": "Old English", + "native": "Englisc", + "rule": [ + "Rule" + ], + "scenario": [ + "Swa" + ], + "scenarioOutline": [ + "Swa hwaer swa", + "Swa hwær swa" + ], + "then": [ + "* ", + "Tha ", + "Þa ", + "Ða ", + "Tha the ", + "Þa þe ", + "Ða ðe " + ], + "when": [ + "* ", + "Tha ", + "Þa ", + "Ða " + ] + }, + "en-pirate": { + "and": [ + "* ", + "Aye " + ], + "background": [ + "Yo-ho-ho" + ], + "but": [ + "* ", + "Avast! " + ], + "examples": [ + "Dead men tell no tales" + ], + "feature": [ + "Ahoy matey!" + ], + "given": [ + "* ", + "Gangway! " + ], + "name": "Pirate", + "native": "Pirate", + "rule": [ + "Rule" + ], + "scenario": [ + "Heave to" + ], + "scenarioOutline": [ + "Shiver me timbers" + ], + "then": [ + "* ", + "Let go and haul " + ], + "when": [ + "* ", + "Blimey! " + ] + }, + "eo": { + "and": [ + "* ", + "Kaj " + ], + "background": [ + "Fono" + ], + "but": [ + "* ", + "Sed " + ], + "examples": [ + "Ekzemploj" + ], + "feature": [ + "Trajto" + ], + "given": [ + "* ", + "Donitaĵo ", + "Komence " + ], + "name": "Esperanto", + "native": "Esperanto", + "rule": [ + "Rule" + ], + "scenario": [ + "Ekzemplo", + "Scenaro", + "Kazo" + ], + "scenarioOutline": [ + "Konturo de la scenaro", + "Skizo", + "Kazo-skizo" + ], + "then": [ + "* ", + "Do " + ], + "when": [ + "* ", + "Se " + ] + }, + "es": { + "and": [ + "* ", + "Y ", + "E " + ], + "background": [ + "Antecedentes" + ], + "but": [ + "* ", + "Pero " + ], + "examples": [ + "Ejemplos" + ], + "feature": [ + "Característica" + ], + "given": [ + "* ", + "Dado ", + "Dada ", + "Dados ", + "Dadas " + ], + "name": "Spanish", + "native": "español", + "rule": [ + "Rule" + ], + "scenario": [ + "Ejemplo", + "Escenario" + ], + "scenarioOutline": [ + "Esquema del escenario" + ], + "then": [ + "* ", + "Entonces " + ], + "when": [ + "* ", + "Cuando " + ] + }, + "et": { + "and": [ + "* ", + "Ja " + ], + "background": [ + "Taust" + ], + "but": [ + "* ", + "Kuid " + ], + "examples": [ + "Juhtumid" + ], + "feature": [ + "Omadus" + ], + "given": [ + "* ", + "Eeldades " + ], + "name": "Estonian", + "native": "eesti keel", + "rule": [ + "Rule" + ], + "scenario": [ + "Juhtum", + "Stsenaarium" + ], + "scenarioOutline": [ + "Raamstjuhtum", + "Raamstsenaarium" + ], + "then": [ + "* ", + "Siis " + ], + "when": [ + "* ", + "Kui " + ] + }, + "fa": { + "and": [ + "* ", + "و " + ], + "background": [ + "زمینه" + ], + "but": [ + "* ", + "اما " + ], + "examples": [ + "نمونه ها" + ], + "feature": [ + "وِیژگی" + ], + "given": [ + "* ", + "با فرض " + ], + "name": "Persian", + "native": "فارسی", + "rule": [ + "Rule" + ], + "scenario": [ + "مثال", + "سناریو" + ], + "scenarioOutline": [ + "الگوی سناریو" + ], + "then": [ + "* ", + "آنگاه " + ], + "when": [ + "* ", + "هنگامی " + ] + }, + "fi": { + "and": [ + "* ", + "Ja " + ], + "background": [ + "Tausta" + ], + "but": [ + "* ", + "Mutta " + ], + "examples": [ + "Tapaukset" + ], + "feature": [ + "Ominaisuus" + ], + "given": [ + "* ", + "Oletetaan " + ], + "name": "Finnish", + "native": "suomi", + "rule": [ + "Rule" + ], + "scenario": [ + "Tapaus" + ], + "scenarioOutline": [ + "Tapausaihio" + ], + "then": [ + "* ", + "Niin " + ], + "when": [ + "* ", + "Kun " + ] + }, + "fr": { + "and": [ + "* ", + "Et que ", + "Et qu'", + "Et " + ], + "background": [ + "Contexte" + ], + "but": [ + "* ", + "Mais que ", + "Mais qu'", + "Mais " + ], + "examples": [ + "Exemples" + ], + "feature": [ + "Fonctionnalité" + ], + "given": [ + "* ", + "Soit ", + "Sachant que ", + "Sachant qu'", + "Sachant ", + "Etant donné que ", + "Etant donné qu'", + "Etant donné ", + "Etant donnée ", + "Etant donnés ", + "Etant données ", + "Étant donné que ", + "Étant donné qu'", + "Étant donné ", + "Étant donnée ", + "Étant donnés ", + "Étant données " + ], + "name": "French", + "native": "français", + "rule": [ + "Règle" + ], + "scenario": [ + "Exemple", + "Scénario" + ], + "scenarioOutline": [ + "Plan du scénario", + "Plan du Scénario" + ], + "then": [ + "* ", + "Alors ", + "Donc " + ], + "when": [ + "* ", + "Quand ", + "Lorsque ", + "Lorsqu'" + ] + }, + "ga": { + "and": [ + "* ", + "Agus" + ], + "background": [ + "Cúlra" + ], + "but": [ + "* ", + "Ach" + ], + "examples": [ + "Samplaí" + ], + "feature": [ + "Gné" + ], + "given": [ + "* ", + "Cuir i gcás go", + "Cuir i gcás nach", + "Cuir i gcás gur", + "Cuir i gcás nár" + ], + "name": "Irish", + "native": "Gaeilge", + "rule": [ + "Rule" + ], + "scenario": [ + "Sampla", + "Cás" + ], + "scenarioOutline": [ + "Cás Achomair" + ], + "then": [ + "* ", + "Ansin" + ], + "when": [ + "* ", + "Nuair a", + "Nuair nach", + "Nuair ba", + "Nuair nár" + ] + }, + "gj": { + "and": [ + "* ", + "અને " + ], + "background": [ + "બેકગ્રાઉન્ડ" + ], + "but": [ + "* ", + "પણ " + ], + "examples": [ + "ઉદાહરણો" + ], + "feature": [ + "લક્ષણ", + "વ્યાપાર જરૂર", + "ક્ષમતા" + ], + "given": [ + "* ", + "આપેલ છે " + ], + "name": "Gujarati", + "native": "ગુજરાતી", + "rule": [ + "Rule" + ], + "scenario": [ + "ઉદાહરણ", + "સ્થિતિ" + ], + "scenarioOutline": [ + "પરિદ્દશ્ય રૂપરેખા", + "પરિદ્દશ્ય ઢાંચો" + ], + "then": [ + "* ", + "પછી " + ], + "when": [ + "* ", + "ક્યારે " + ] + }, + "gl": { + "and": [ + "* ", + "E " + ], + "background": [ + "Contexto" + ], + "but": [ + "* ", + "Mais ", + "Pero " + ], + "examples": [ + "Exemplos" + ], + "feature": [ + "Característica" + ], + "given": [ + "* ", + "Dado ", + "Dada ", + "Dados ", + "Dadas " + ], + "name": "Galician", + "native": "galego", + "rule": [ + "Rule" + ], + "scenario": [ + "Exemplo", + "Escenario" + ], + "scenarioOutline": [ + "Esbozo do escenario" + ], + "then": [ + "* ", + "Entón ", + "Logo " + ], + "when": [ + "* ", + "Cando " + ] + }, + "he": { + "and": [ + "* ", + "וגם " + ], + "background": [ + "רקע" + ], + "but": [ + "* ", + "אבל " + ], + "examples": [ + "דוגמאות" + ], + "feature": [ + "תכונה" + ], + "given": [ + "* ", + "בהינתן " + ], + "name": "Hebrew", + "native": "עברית", + "rule": [ + "Rule" + ], + "scenario": [ + "דוגמא", + "תרחיש" + ], + "scenarioOutline": [ + "תבנית תרחיש" + ], + "then": [ + "* ", + "אז ", + "אזי " + ], + "when": [ + "* ", + "כאשר " + ] + }, + "hi": { + "and": [ + "* ", + "और ", + "तथा " + ], + "background": [ + "पृष्ठभूमि" + ], + "but": [ + "* ", + "पर ", + "परन्तु ", + "किन्तु " + ], + "examples": [ + "उदाहरण" + ], + "feature": [ + "रूप लेख" + ], + "given": [ + "* ", + "अगर ", + "यदि ", + "चूंकि " + ], + "name": "Hindi", + "native": "हिंदी", + "rule": [ + "Rule" + ], + "scenario": [ + "परिदृश्य" + ], + "scenarioOutline": [ + "परिदृश्य रूपरेखा" + ], + "then": [ + "* ", + "तब ", + "तदा " + ], + "when": [ + "* ", + "जब ", + "कदा " + ] + }, + "hr": { + "and": [ + "* ", + "I " + ], + "background": [ + "Pozadina" + ], + "but": [ + "* ", + "Ali " + ], + "examples": [ + "Primjeri", + "Scenariji" + ], + "feature": [ + "Osobina", + "Mogućnost", + "Mogucnost" + ], + "given": [ + "* ", + "Zadan ", + "Zadani ", + "Zadano ", + "Ukoliko " + ], + "name": "Croatian", + "native": "hrvatski", + "rule": [ + "Rule" + ], + "scenario": [ + "Primjer", + "Scenarij" + ], + "scenarioOutline": [ + "Skica", + "Koncept" + ], + "then": [ + "* ", + "Onda " + ], + "when": [ + "* ", + "Kada ", + "Kad " + ] + }, + "ht": { + "and": [ + "* ", + "Ak ", + "Epi ", + "E " + ], + "background": [ + "Kontèks", + "Istorik" + ], + "but": [ + "* ", + "Men " + ], + "examples": [ + "Egzanp" + ], + "feature": [ + "Karakteristik", + "Mak", + "Fonksyonalite" + ], + "given": [ + "* ", + "Sipoze ", + "Sipoze ke ", + "Sipoze Ke " + ], + "name": "Creole", + "native": "kreyòl", + "rule": [ + "Rule" + ], + "scenario": [ + "Senaryo" + ], + "scenarioOutline": [ + "Plan senaryo", + "Plan Senaryo", + "Senaryo deskripsyon", + "Senaryo Deskripsyon", + "Dyagram senaryo", + "Dyagram Senaryo" + ], + "then": [ + "* ", + "Lè sa a ", + "Le sa a " + ], + "when": [ + "* ", + "Lè ", + "Le " + ] + }, + "hu": { + "and": [ + "* ", + "És " + ], + "background": [ + "Háttér" + ], + "but": [ + "* ", + "De " + ], + "examples": [ + "Példák" + ], + "feature": [ + "Jellemző" + ], + "given": [ + "* ", + "Amennyiben ", + "Adott " + ], + "name": "Hungarian", + "native": "magyar", + "rule": [ + "Rule" + ], + "scenario": [ + "Példa", + "Forgatókönyv" + ], + "scenarioOutline": [ + "Forgatókönyv vázlat" + ], + "then": [ + "* ", + "Akkor " + ], + "when": [ + "* ", + "Majd ", + "Ha ", + "Amikor " + ] + }, + "id": { + "and": [ + "* ", + "Dan " + ], + "background": [ + "Dasar" + ], + "but": [ + "* ", + "Tapi " + ], + "examples": [ + "Contoh" + ], + "feature": [ + "Fitur" + ], + "given": [ + "* ", + "Dengan " + ], + "name": "Indonesian", + "native": "Bahasa Indonesia", + "rule": [ + "Rule" + ], + "scenario": [ + "Skenario" + ], + "scenarioOutline": [ + "Skenario konsep" + ], + "then": [ + "* ", + "Maka " + ], + "when": [ + "* ", + "Ketika " + ] + }, + "is": { + "and": [ + "* ", + "Og " + ], + "background": [ + "Bakgrunnur" + ], + "but": [ + "* ", + "En " + ], + "examples": [ + "Dæmi", + "Atburðarásir" + ], + "feature": [ + "Eiginleiki" + ], + "given": [ + "* ", + "Ef " + ], + "name": "Icelandic", + "native": "Íslenska", + "rule": [ + "Rule" + ], + "scenario": [ + "Atburðarás" + ], + "scenarioOutline": [ + "Lýsing Atburðarásar", + "Lýsing Dæma" + ], + "then": [ + "* ", + "Þá " + ], + "when": [ + "* ", + "Þegar " + ] + }, + "it": { + "and": [ + "* ", + "E " + ], + "background": [ + "Contesto" + ], + "but": [ + "* ", + "Ma " + ], + "examples": [ + "Esempi" + ], + "feature": [ + "Funzionalità" + ], + "given": [ + "* ", + "Dato ", + "Data ", + "Dati ", + "Date " + ], + "name": "Italian", + "native": "italiano", + "rule": [ + "Rule" + ], + "scenario": [ + "Esempio", + "Scenario" + ], + "scenarioOutline": [ + "Schema dello scenario" + ], + "then": [ + "* ", + "Allora " + ], + "when": [ + "* ", + "Quando " + ] + }, + "ja": { + "and": [ + "* ", + "かつ" + ], + "background": [ + "背景" + ], + "but": [ + "* ", + "しかし", + "但し", + "ただし" + ], + "examples": [ + "例", + "サンプル" + ], + "feature": [ + "フィーチャ", + "機能" + ], + "given": [ + "* ", + "前提" + ], + "name": "Japanese", + "native": "日本語", + "rule": [ + "Rule" + ], + "scenario": [ + "シナリオ" + ], + "scenarioOutline": [ + "シナリオアウトライン", + "シナリオテンプレート", + "テンプレ", + "シナリオテンプレ" + ], + "then": [ + "* ", + "ならば" + ], + "when": [ + "* ", + "もし" + ] + }, + "jv": { + "and": [ + "* ", + "Lan " + ], + "background": [ + "Dasar" + ], + "but": [ + "* ", + "Tapi ", + "Nanging ", + "Ananging " + ], + "examples": [ + "Conto", + "Contone" + ], + "feature": [ + "Fitur" + ], + "given": [ + "* ", + "Nalika ", + "Nalikaning " + ], + "name": "Javanese", + "native": "Basa Jawa", + "rule": [ + "Rule" + ], + "scenario": [ + "Skenario" + ], + "scenarioOutline": [ + "Konsep skenario" + ], + "then": [ + "* ", + "Njuk ", + "Banjur " + ], + "when": [ + "* ", + "Manawa ", + "Menawa " + ] + }, + "ka": { + "and": [ + "* ", + "და" + ], + "background": [ + "კონტექსტი" + ], + "but": [ + "* ", + "მაგ­რამ" + ], + "examples": [ + "მაგალითები" + ], + "feature": [ + "თვისება" + ], + "given": [ + "* ", + "მოცემული" + ], + "name": "Georgian", + "native": "ქართველი", + "rule": [ + "Rule" + ], + "scenario": [ + "მაგალითად", + "სცენარის" + ], + "scenarioOutline": [ + "სცენარის ნიმუში" + ], + "then": [ + "* ", + "მაშინ" + ], + "when": [ + "* ", + "როდესაც" + ] + }, + "kn": { + "and": [ + "* ", + "ಮತ್ತು " + ], + "background": [ + "ಹಿನ್ನೆಲೆ" + ], + "but": [ + "* ", + "ಆದರೆ " + ], + "examples": [ + "ಉದಾಹರಣೆಗಳು" + ], + "feature": [ + "ಹೆಚ್ಚಳ" + ], + "given": [ + "* ", + "ನೀಡಿದ " + ], + "name": "Kannada", + "native": "ಕನ್ನಡ", + "rule": [ + "Rule" + ], + "scenario": [ + "ಉದಾಹರಣೆ", + "ಕಥಾಸಾರಾಂಶ" + ], + "scenarioOutline": [ + "ವಿವರಣೆ" + ], + "then": [ + "* ", + "ನಂತರ " + ], + "when": [ + "* ", + "ಸ್ಥಿತಿಯನ್ನು " + ] + }, + "ko": { + "and": [ + "* ", + "그리고" + ], + "background": [ + "배경" + ], + "but": [ + "* ", + "하지만", + "단" + ], + "examples": [ + "예" + ], + "feature": [ + "기능" + ], + "given": [ + "* ", + "조건", + "먼저" + ], + "name": "Korean", + "native": "한국어", + "rule": [ + "Rule" + ], + "scenario": [ + "시나리오" + ], + "scenarioOutline": [ + "시나리오 개요" + ], + "then": [ + "* ", + "그러면" + ], + "when": [ + "* ", + "만일", + "만약" + ] + }, + "lt": { + "and": [ + "* ", + "Ir " + ], + "background": [ + "Kontekstas" + ], + "but": [ + "* ", + "Bet " + ], + "examples": [ + "Pavyzdžiai", + "Scenarijai", + "Variantai" + ], + "feature": [ + "Savybė" + ], + "given": [ + "* ", + "Duota " + ], + "name": "Lithuanian", + "native": "lietuvių kalba", + "rule": [ + "Rule" + ], + "scenario": [ + "Pavyzdys", + "Scenarijus" + ], + "scenarioOutline": [ + "Scenarijaus šablonas" + ], + "then": [ + "* ", + "Tada " + ], + "when": [ + "* ", + "Kai " + ] + }, + "lu": { + "and": [ + "* ", + "an ", + "a " + ], + "background": [ + "Hannergrond" + ], + "but": [ + "* ", + "awer ", + "mä " + ], + "examples": [ + "Beispiller" + ], + "feature": [ + "Funktionalitéit" + ], + "given": [ + "* ", + "ugeholl " + ], + "name": "Luxemburgish", + "native": "Lëtzebuergesch", + "rule": [ + "Rule" + ], + "scenario": [ + "Beispill", + "Szenario" + ], + "scenarioOutline": [ + "Plang vum Szenario" + ], + "then": [ + "* ", + "dann " + ], + "when": [ + "* ", + "wann " + ] + }, + "lv": { + "and": [ + "* ", + "Un " + ], + "background": [ + "Konteksts", + "Situācija" + ], + "but": [ + "* ", + "Bet " + ], + "examples": [ + "Piemēri", + "Paraugs" + ], + "feature": [ + "Funkcionalitāte", + "Fīča" + ], + "given": [ + "* ", + "Kad " + ], + "name": "Latvian", + "native": "latviešu", + "rule": [ + "Rule" + ], + "scenario": [ + "Piemērs", + "Scenārijs" + ], + "scenarioOutline": [ + "Scenārijs pēc parauga" + ], + "then": [ + "* ", + "Tad " + ], + "when": [ + "* ", + "Ja " + ] + }, + "mk-Cyrl": { + "and": [ + "* ", + "И " + ], + "background": [ + "Контекст", + "Содржина" + ], + "but": [ + "* ", + "Но " + ], + "examples": [ + "Примери", + "Сценарија" + ], + "feature": [ + "Функционалност", + "Бизнис потреба", + "Можност" + ], + "given": [ + "* ", + "Дадено ", + "Дадена " + ], + "name": "Macedonian", + "native": "Македонски", + "rule": [ + "Rule" + ], + "scenario": [ + "Пример", + "Сценарио", + "На пример" + ], + "scenarioOutline": [ + "Преглед на сценарија", + "Скица", + "Концепт" + ], + "then": [ + "* ", + "Тогаш " + ], + "when": [ + "* ", + "Кога " + ] + }, + "mk-Latn": { + "and": [ + "* ", + "I " + ], + "background": [ + "Kontekst", + "Sodrzhina" + ], + "but": [ + "* ", + "No " + ], + "examples": [ + "Primeri", + "Scenaria" + ], + "feature": [ + "Funkcionalnost", + "Biznis potreba", + "Mozhnost" + ], + "given": [ + "* ", + "Dadeno ", + "Dadena " + ], + "name": "Macedonian (Latin)", + "native": "Makedonski (Latinica)", + "rule": [ + "Rule" + ], + "scenario": [ + "Scenario", + "Na primer" + ], + "scenarioOutline": [ + "Pregled na scenarija", + "Skica", + "Koncept" + ], + "then": [ + "* ", + "Togash " + ], + "when": [ + "* ", + "Koga " + ] + }, + "mn": { + "and": [ + "* ", + "Мөн ", + "Тэгээд " + ], + "background": [ + "Агуулга" + ], + "but": [ + "* ", + "Гэхдээ ", + "Харин " + ], + "examples": [ + "Тухайлбал" + ], + "feature": [ + "Функц", + "Функционал" + ], + "given": [ + "* ", + "Өгөгдсөн нь ", + "Анх " + ], + "name": "Mongolian", + "native": "монгол", + "rule": [ + "Rule" + ], + "scenario": [ + "Сценар" + ], + "scenarioOutline": [ + "Сценарын төлөвлөгөө" + ], + "then": [ + "* ", + "Тэгэхэд ", + "Үүний дараа " + ], + "when": [ + "* ", + "Хэрэв " + ] + }, + "nl": { + "and": [ + "* ", + "En " + ], + "background": [ + "Achtergrond" + ], + "but": [ + "* ", + "Maar " + ], + "examples": [ + "Voorbeelden" + ], + "feature": [ + "Functionaliteit" + ], + "given": [ + "* ", + "Gegeven ", + "Stel " + ], + "name": "Dutch", + "native": "Nederlands", + "rule": [ + "Rule" + ], + "scenario": [ + "Voorbeeld", + "Scenario" + ], + "scenarioOutline": [ + "Abstract Scenario" + ], + "then": [ + "* ", + "Dan " + ], + "when": [ + "* ", + "Als ", + "Wanneer " + ] + }, + "no": { + "and": [ + "* ", + "Og " + ], + "background": [ + "Bakgrunn" + ], + "but": [ + "* ", + "Men " + ], + "examples": [ + "Eksempler" + ], + "feature": [ + "Egenskap" + ], + "given": [ + "* ", + "Gitt " + ], + "name": "Norwegian", + "native": "norsk", + "rule": [ + "Regel" + ], + "scenario": [ + "Eksempel", + "Scenario" + ], + "scenarioOutline": [ + "Scenariomal", + "Abstrakt Scenario" + ], + "then": [ + "* ", + "Så " + ], + "when": [ + "* ", + "Når " + ] + }, + "pa": { + "and": [ + "* ", + "ਅਤੇ " + ], + "background": [ + "ਪਿਛੋਕੜ" + ], + "but": [ + "* ", + "ਪਰ " + ], + "examples": [ + "ਉਦਾਹਰਨਾਂ" + ], + "feature": [ + "ਖਾਸੀਅਤ", + "ਮੁਹਾਂਦਰਾ", + "ਨਕਸ਼ ਨੁਹਾਰ" + ], + "given": [ + "* ", + "ਜੇਕਰ ", + "ਜਿਵੇਂ ਕਿ " + ], + "name": "Panjabi", + "native": "ਪੰਜਾਬੀ", + "rule": [ + "Rule" + ], + "scenario": [ + "ਉਦਾਹਰਨ", + "ਪਟਕਥਾ" + ], + "scenarioOutline": [ + "ਪਟਕਥਾ ਢਾਂਚਾ", + "ਪਟਕਥਾ ਰੂਪ ਰੇਖਾ" + ], + "then": [ + "* ", + "ਤਦ " + ], + "when": [ + "* ", + "ਜਦੋਂ " + ] + }, + "pl": { + "and": [ + "* ", + "Oraz ", + "I " + ], + "background": [ + "Założenia" + ], + "but": [ + "* ", + "Ale " + ], + "examples": [ + "Przykłady" + ], + "feature": [ + "Właściwość", + "Funkcja", + "Aspekt", + "Potrzeba biznesowa" + ], + "given": [ + "* ", + "Zakładając ", + "Mając ", + "Zakładając, że " + ], + "name": "Polish", + "native": "polski", + "rule": [ + "Rule" + ], + "scenario": [ + "Przykład", + "Scenariusz" + ], + "scenarioOutline": [ + "Szablon scenariusza" + ], + "then": [ + "* ", + "Wtedy " + ], + "when": [ + "* ", + "Jeżeli ", + "Jeśli ", + "Gdy ", + "Kiedy " + ] + }, + "pt": { + "and": [ + "* ", + "E " + ], + "background": [ + "Contexto", + "Cenário de Fundo", + "Cenario de Fundo", + "Fundo" + ], + "but": [ + "* ", + "Mas " + ], + "examples": [ + "Exemplos", + "Cenários", + "Cenarios" + ], + "feature": [ + "Funcionalidade", + "Característica", + "Caracteristica" + ], + "given": [ + "* ", + "Dado ", + "Dada ", + "Dados ", + "Dadas " + ], + "name": "Portuguese", + "native": "português", + "rule": [ + "Rule" + ], + "scenario": [ + "Exemplo", + "Cenário", + "Cenario" + ], + "scenarioOutline": [ + "Esquema do Cenário", + "Esquema do Cenario", + "Delineação do Cenário", + "Delineacao do Cenario" + ], + "then": [ + "* ", + "Então ", + "Entao " + ], + "when": [ + "* ", + "Quando " + ] + }, + "ro": { + "and": [ + "* ", + "Si ", + "Și ", + "Şi " + ], + "background": [ + "Context" + ], + "but": [ + "* ", + "Dar " + ], + "examples": [ + "Exemple" + ], + "feature": [ + "Functionalitate", + "Funcționalitate", + "Funcţionalitate" + ], + "given": [ + "* ", + "Date fiind ", + "Dat fiind ", + "Dată fiind", + "Dati fiind ", + "Dați fiind ", + "Daţi fiind " + ], + "name": "Romanian", + "native": "română", + "rule": [ + "Rule" + ], + "scenario": [ + "Exemplu", + "Scenariu" + ], + "scenarioOutline": [ + "Structura scenariu", + "Structură scenariu" + ], + "then": [ + "* ", + "Atunci " + ], + "when": [ + "* ", + "Cand ", + "Când " + ] + }, + "ru": { + "and": [ + "* ", + "И ", + "К тому же ", + "Также " + ], + "background": [ + "Предыстория", + "Контекст" + ], + "but": [ + "* ", + "Но ", + "А ", + "Иначе " + ], + "examples": [ + "Примеры" + ], + "feature": [ + "Функция", + "Функциональность", + "Функционал", + "Свойство" + ], + "given": [ + "* ", + "Допустим ", + "Дано ", + "Пусть " + ], + "name": "Russian", + "native": "русский", + "rule": [ + "Rule" + ], + "scenario": [ + "Пример", + "Сценарий" + ], + "scenarioOutline": [ + "Структура сценария" + ], + "then": [ + "* ", + "То ", + "Затем ", + "Тогда " + ], + "when": [ + "* ", + "Когда ", + "Если " + ] + }, + "sk": { + "and": [ + "* ", + "A ", + "A tiež ", + "A taktiež ", + "A zároveň " + ], + "background": [ + "Pozadie" + ], + "but": [ + "* ", + "Ale " + ], + "examples": [ + "Príklady" + ], + "feature": [ + "Požiadavka", + "Funkcia", + "Vlastnosť" + ], + "given": [ + "* ", + "Pokiaľ ", + "Za predpokladu " + ], + "name": "Slovak", + "native": "Slovensky", + "rule": [ + "Rule" + ], + "scenario": [ + "Príklad", + "Scenár" + ], + "scenarioOutline": [ + "Náčrt Scenáru", + "Náčrt Scenára", + "Osnova Scenára" + ], + "then": [ + "* ", + "Tak ", + "Potom " + ], + "when": [ + "* ", + "Keď ", + "Ak " + ] + }, + "sl": { + "and": [ + "In ", + "Ter " + ], + "background": [ + "Kontekst", + "Osnova", + "Ozadje" + ], + "but": [ + "Toda ", + "Ampak ", + "Vendar " + ], + "examples": [ + "Primeri", + "Scenariji" + ], + "feature": [ + "Funkcionalnost", + "Funkcija", + "Možnosti", + "Moznosti", + "Lastnost", + "Značilnost" + ], + "given": [ + "Dano ", + "Podano ", + "Zaradi ", + "Privzeto " + ], + "name": "Slovenian", + "native": "Slovenski", + "rule": [ + "Rule" + ], + "scenario": [ + "Primer", + "Scenarij" + ], + "scenarioOutline": [ + "Struktura scenarija", + "Skica", + "Koncept", + "Oris scenarija", + "Osnutek" + ], + "then": [ + "Nato ", + "Potem ", + "Takrat " + ], + "when": [ + "Ko ", + "Ce ", + "Če ", + "Kadar " + ] + }, + "sr-Cyrl": { + "and": [ + "* ", + "И " + ], + "background": [ + "Контекст", + "Основа", + "Позадина" + ], + "but": [ + "* ", + "Али " + ], + "examples": [ + "Примери", + "Сценарији" + ], + "feature": [ + "Функционалност", + "Могућност", + "Особина" + ], + "given": [ + "* ", + "За дато ", + "За дате ", + "За дати " + ], + "name": "Serbian", + "native": "Српски", + "rule": [ + "Rule" + ], + "scenario": [ + "Пример", + "Сценарио", + "Пример" + ], + "scenarioOutline": [ + "Структура сценарија", + "Скица", + "Концепт" + ], + "then": [ + "* ", + "Онда " + ], + "when": [ + "* ", + "Када ", + "Кад " + ] + }, + "sr-Latn": { + "and": [ + "* ", + "I " + ], + "background": [ + "Kontekst", + "Osnova", + "Pozadina" + ], + "but": [ + "* ", + "Ali " + ], + "examples": [ + "Primeri", + "Scenariji" + ], + "feature": [ + "Funkcionalnost", + "Mogućnost", + "Mogucnost", + "Osobina" + ], + "given": [ + "* ", + "Za dato ", + "Za date ", + "Za dati " + ], + "name": "Serbian (Latin)", + "native": "Srpski (Latinica)", + "rule": [ + "Rule" + ], + "scenario": [ + "Scenario", + "Primer" + ], + "scenarioOutline": [ + "Struktura scenarija", + "Skica", + "Koncept" + ], + "then": [ + "* ", + "Onda " + ], + "when": [ + "* ", + "Kada ", + "Kad " + ] + }, + "sv": { + "and": [ + "* ", + "Och " + ], + "background": [ + "Bakgrund" + ], + "but": [ + "* ", + "Men " + ], + "examples": [ + "Exempel" + ], + "feature": [ + "Egenskap" + ], + "given": [ + "* ", + "Givet " + ], + "name": "Swedish", + "native": "Svenska", + "rule": [ + "Rule" + ], + "scenario": [ + "Scenario" + ], + "scenarioOutline": [ + "Abstrakt Scenario", + "Scenariomall" + ], + "then": [ + "* ", + "Så " + ], + "when": [ + "* ", + "När " + ] + }, + "ta": { + "and": [ + "* ", + "மேலும் ", + "மற்றும் " + ], + "background": [ + "பின்னணி" + ], + "but": [ + "* ", + "ஆனால் " + ], + "examples": [ + "எடுத்துக்காட்டுகள்", + "காட்சிகள்", + "நிலைமைகளில்" + ], + "feature": [ + "அம்சம்", + "வணிக தேவை", + "திறன்" + ], + "given": [ + "* ", + "கொடுக்கப்பட்ட " + ], + "name": "Tamil", + "native": "தமிழ்", + "rule": [ + "Rule" + ], + "scenario": [ + "உதாரணமாக", + "காட்சி" + ], + "scenarioOutline": [ + "காட்சி சுருக்கம்", + "காட்சி வார்ப்புரு" + ], + "then": [ + "* ", + "அப்பொழுது " + ], + "when": [ + "* ", + "எப்போது " + ] + }, + "th": { + "and": [ + "* ", + "และ " + ], + "background": [ + "แนวคิด" + ], + "but": [ + "* ", + "แต่ " + ], + "examples": [ + "ชุดของตัวอย่าง", + "ชุดของเหตุการณ์" + ], + "feature": [ + "โครงหลัก", + "ความต้องการทางธุรกิจ", + "ความสามารถ" + ], + "given": [ + "* ", + "กำหนดให้ " + ], + "name": "Thai", + "native": "ไทย", + "rule": [ + "Rule" + ], + "scenario": [ + "เหตุการณ์" + ], + "scenarioOutline": [ + "สรุปเหตุการณ์", + "โครงสร้างของเหตุการณ์" + ], + "then": [ + "* ", + "ดังนั้น " + ], + "when": [ + "* ", + "เมื่อ " + ] + }, + "tl": { + "and": [ + "* ", + "మరియు " + ], + "background": [ + "నేపథ్యం" + ], + "but": [ + "* ", + "కాని " + ], + "examples": [ + "ఉదాహరణలు" + ], + "feature": [ + "గుణము" + ], + "given": [ + "* ", + "చెప్పబడినది " + ], + "name": "Telugu", + "native": "తెలుగు", + "rule": [ + "Rule" + ], + "scenario": [ + "ఉదాహరణ", + "సన్నివేశం" + ], + "scenarioOutline": [ + "కథనం" + ], + "then": [ + "* ", + "అప్పుడు " + ], + "when": [ + "* ", + "ఈ పరిస్థితిలో " + ] + }, + "tlh": { + "and": [ + "* ", + "'ej ", + "latlh " + ], + "background": [ + "mo'" + ], + "but": [ + "* ", + "'ach ", + "'a " + ], + "examples": [ + "ghantoH", + "lutmey" + ], + "feature": [ + "Qap", + "Qu'meH 'ut", + "perbogh", + "poQbogh malja'", + "laH" + ], + "given": [ + "* ", + "ghu' noblu' ", + "DaH ghu' bejlu' " + ], + "name": "Klingon", + "native": "tlhIngan", + "rule": [ + "Rule" + ], + "scenario": [ + "lut" + ], + "scenarioOutline": [ + "lut chovnatlh" + ], + "then": [ + "* ", + "vaj " + ], + "when": [ + "* ", + "qaSDI' " + ] + }, + "tr": { + "and": [ + "* ", + "Ve " + ], + "background": [ + "Geçmiş" + ], + "but": [ + "* ", + "Fakat ", + "Ama " + ], + "examples": [ + "Örnekler" + ], + "feature": [ + "Özellik" + ], + "given": [ + "* ", + "Diyelim ki " + ], + "name": "Turkish", + "native": "Türkçe", + "rule": [ + "Rule" + ], + "scenario": [ + "Örnek", + "Senaryo" + ], + "scenarioOutline": [ + "Senaryo taslağı" + ], + "then": [ + "* ", + "O zaman " + ], + "when": [ + "* ", + "Eğer ki " + ] + }, + "tt": { + "and": [ + "* ", + "Һәм ", + "Вә " + ], + "background": [ + "Кереш" + ], + "but": [ + "* ", + "Ләкин ", + "Әмма " + ], + "examples": [ + "Үрнәкләр", + "Мисаллар" + ], + "feature": [ + "Мөмкинлек", + "Үзенчәлеклелек" + ], + "given": [ + "* ", + "Әйтик " + ], + "name": "Tatar", + "native": "Татарча", + "rule": [ + "Rule" + ], + "scenario": [ + "Сценарий" + ], + "scenarioOutline": [ + "Сценарийның төзелеше" + ], + "then": [ + "* ", + "Нәтиҗәдә " + ], + "when": [ + "* ", + "Әгәр " + ] + }, + "uk": { + "and": [ + "* ", + "І ", + "А також ", + "Та " + ], + "background": [ + "Передумова" + ], + "but": [ + "* ", + "Але " + ], + "examples": [ + "Приклади" + ], + "feature": [ + "Функціонал" + ], + "given": [ + "* ", + "Припустимо ", + "Припустимо, що ", + "Нехай ", + "Дано " + ], + "name": "Ukrainian", + "native": "Українська", + "rule": [ + "Rule" + ], + "scenario": [ + "Приклад", + "Сценарій" + ], + "scenarioOutline": [ + "Структура сценарію" + ], + "then": [ + "* ", + "То ", + "Тоді " + ], + "when": [ + "* ", + "Якщо ", + "Коли " + ] + }, + "ur": { + "and": [ + "* ", + "اور " + ], + "background": [ + "پس منظر" + ], + "but": [ + "* ", + "لیکن " + ], + "examples": [ + "مثالیں" + ], + "feature": [ + "صلاحیت", + "کاروبار کی ضرورت", + "خصوصیت" + ], + "given": [ + "* ", + "اگر ", + "بالفرض ", + "فرض کیا " + ], + "name": "Urdu", + "native": "اردو", + "rule": [ + "Rule" + ], + "scenario": [ + "منظرنامہ" + ], + "scenarioOutline": [ + "منظر نامے کا خاکہ" + ], + "then": [ + "* ", + "پھر ", + "تب " + ], + "when": [ + "* ", + "جب " + ] + }, + "uz": { + "and": [ + "* ", + "Ва " + ], + "background": [ + "Тарих" + ], + "but": [ + "* ", + "Лекин ", + "Бирок ", + "Аммо " + ], + "examples": [ + "Мисоллар" + ], + "feature": [ + "Функционал" + ], + "given": [ + "* ", + "Агар " + ], + "name": "Uzbek", + "native": "Узбекча", + "rule": [ + "Rule" + ], + "scenario": [ + "Сценарий" + ], + "scenarioOutline": [ + "Сценарий структураси" + ], + "then": [ + "* ", + "Унда " + ], + "when": [ + "* ", + "Агар " + ] + }, + "vi": { + "and": [ + "* ", + "Và " + ], + "background": [ + "Bối cảnh" + ], + "but": [ + "* ", + "Nhưng " + ], + "examples": [ + "Dữ liệu" + ], + "feature": [ + "Tính năng" + ], + "given": [ + "* ", + "Biết ", + "Cho " + ], + "name": "Vietnamese", + "native": "Tiếng Việt", + "rule": [ + "Rule" + ], + "scenario": [ + "Tình huống", + "Kịch bản" + ], + "scenarioOutline": [ + "Khung tình huống", + "Khung kịch bản" + ], + "then": [ + "* ", + "Thì " + ], + "when": [ + "* ", + "Khi " + ] + }, + "zh-CN": { + "and": [ + "* ", + "而且", + "并且", + "同时" + ], + "background": [ + "背景" + ], + "but": [ + "* ", + "但是" + ], + "examples": [ + "例子" + ], + "feature": [ + "功能" + ], + "given": [ + "* ", + "假如", + "假设", + "假定" + ], + "name": "Chinese simplified", + "native": "简体中文", + "rule": [ + "Rule" + ], + "scenario": [ + "场景", + "剧本" + ], + "scenarioOutline": [ + "场景大纲", + "剧本大纲" + ], + "then": [ + "* ", + "那么" + ], + "when": [ + "* ", + "当" + ] + }, + "zh-TW": { + "and": [ + "* ", + "而且", + "並且", + "同時" + ], + "background": [ + "背景" + ], + "but": [ + "* ", + "但是" + ], + "examples": [ + "例子" + ], + "feature": [ + "功能" + ], + "given": [ + "* ", + "假如", + "假設", + "假定" + ], + "name": "Chinese traditional", + "native": "繁體中文", + "rule": [ + "Rule" + ], + "scenario": [ + "場景", + "劇本" + ], + "scenarioOutline": [ + "場景大綱", + "劇本大綱" + ], + "then": [ + "* ", + "那麼" + ], + "when": [ + "* ", + "當" + ] + } +} diff --git a/lib/gherkin/elements/line.ex b/lib/gherkin/elements/line.ex index c5eec0a..15450a4 100644 --- a/lib/gherkin/elements/line.ex +++ b/lib/gherkin/elements/line.ex @@ -1,5 +1,10 @@ defmodule Gherkin.Elements.Line do @moduledoc false - + defstruct raw_text: "", text: "", line_number: nil + + def get_line_name(line_text) do + [_, line_name] = String.split(line_text, ":", parts: 2) + line_name + end end diff --git a/lib/gherkin/keywords.ex b/lib/gherkin/keywords.ex new file mode 100644 index 0000000..2e6af09 --- /dev/null +++ b/lib/gherkin/keywords.ex @@ -0,0 +1,120 @@ +defmodule Gherkin.Keywords do + alias __MODULE__ + + @keywords_file_path Path.expand("../../gherkin-languages.json", __DIR__) + + defstruct and: [], + background: [], + but: [], + examples: [], + feature: [], + given: [], + name: "", + native: "", + rule: [], + scenario: [], + scenario_outline: [], + then: [], + when: [] + + @doc """ + Get keywords from loaded keywords for given language + + Returns a Keywords struct with atom keys + """ + def get_keywords(language \\ "en") do + keywords_map = language + |> load_language_keywords() + |> atomize_map() + + struct!(Keywords, keywords_map) + end + + @doc """ + Transform a given keyword struct into a list of keywords + And optionally filter it with given keys list + + Returns a list of keyword strings + """ + def get_keywords_list(%Keywords{} = keywords, keys_list \\ nil) do + list = keywords + |> setup_list() + |> Enum.filter(fn ({_, keyword}) -> is_list(keyword) end) + filtered_list = if keys_list, do: Enum.filter(list, fn ({key, _}) -> Enum.member?(keys_list, key) end), else: list + cleanup_list(filtered_list) + end + + def get_step_keywords_list(keywords) do + get_keywords_list(keywords, [:given, :when, :then, :and, :but]) + end + + def get_description_keywords_list(keywords) do + get_keywords_list(keywords, [:background, :feature, :examples, :scenario, :given, :rule, :then, :and, :but]) + end + + @doc """ + Find a matched keyword from given keywords list inside given text + + Returns a keyword string + """ + def find_keyword_from_list(text, keywords) do + Enum.find( + keywords, + fn keyword -> + String.match?(text, ~r/^\b(#{keyword})(\b|:)/) + end + ) + end + + @doc """ + Check if given text contains on of the given keywords + + Returns a boolean + """ + def match_keywords?(text, keywords) do + Enum.any?( + keywords, + fn keyword -> + String.match?(text, ~r/^\b(#{keyword})(\b|:)/) + end + ) + end + + defp setup_list(%Keywords{} = keywords) do + # Transform a Keywords struct into a map and filter keywords keys which aren't lists (eg. name or native) + keywords + |> Map.from_struct() + |> Enum.filter(fn ({_, keyword}) -> is_list(keyword) end) + end + + defp cleanup_list(list) do + list + |> Enum.map(fn ({_, value}) -> value end) + |> List.flatten() + |> Enum.filter(fn value -> value != "* " end) + |> Enum.map(fn value -> String.trim(value) end) + end + + defp load_language_keywords(language) do + case get_json(@keywords_file_path) do + %{^language => json_keywords} -> json_keywords + _ -> raise("Language \"#{language}\" is not included in gherkin-language.") + end + end + + defp get_json(filename) do + with {:ok, body} <- File.read(filename), + {:ok, json} <- Jason.decode(body), do: json + end + + defp atomize_map(map) do + for {key, val} <- map, + into: %{}, + do: { + key + |> Macro.underscore() + |> String.to_atom(), + val + } + end +end diff --git a/lib/gherkin/parser.ex b/lib/gherkin/parser.ex index 04a8764..68c722b 100644 --- a/lib/gherkin/parser.ex +++ b/lib/gherkin/parser.ex @@ -1,5 +1,7 @@ defmodule Gherkin.Parser do @moduledoc false + alias Gherkin.Elements.Feature + alias Gherkin.Keywords alias Gherkin.Parsers.FeatureParser @doc """ @@ -37,8 +39,8 @@ defmodule Gherkin.Parser do defp normalize_lines(lines) do lines |> Stream.map(&trim/1) - # Drop empty lines and comment lines as nothing will be done with them - |> Stream.filter(fn line -> line.text != "" and not String.starts_with?(line.text, "#") end) + # Drop empty lines and comment lines (but not language line) as nothing will be done with them + |> Stream.filter(fn line -> line.text != "" and not Regex.match?(~r/^#(?! language)/, line.text) end) |> Enum.reduce([], &normalize_line/2) |> Enum.reverse() end @@ -56,7 +58,7 @@ defmodule Gherkin.Parser do defp normalize_line(%{text: ~s(""") <> _} = line, lines) do indent_length = String.length(line.raw_text) - String.length(line.text) - {{:multiline, indent_length}, [line| lines]} + {{:multiline, indent_length}, [line | lines]} end # Line between opening/closing quotes for Doc String @@ -66,9 +68,17 @@ defmodule Gherkin.Parser do end # Default processing - defp normalize_line(line, lines), do: [line| lines] + defp normalize_line(line, lines), do: [line | lines] defp build_gherkin_document(lines, file) do - FeatureParser.build_feature(%Gherkin.Elements.Feature{file: file}, lines) + keywords = build_feature_keywords(List.first(lines)) + + FeatureParser.build_feature(%Feature{file: file}, lines, keywords) + end + + defp build_feature_keywords(%{text: "# language: " <> language}) do + Keywords.get_keywords(language) end + + defp build_feature_keywords(_), do: Keywords.get_keywords() end diff --git a/lib/gherkin/parsers/background_parser.ex b/lib/gherkin/parsers/background_parser.ex index 86e9de3..fbc2460 100644 --- a/lib/gherkin/parsers/background_parser.ex +++ b/lib/gherkin/parsers/background_parser.ex @@ -4,8 +4,8 @@ defmodule Gherkin.Parsers.BackgroundParser do alias Gherkin.Parsers.DescriptionParser alias Gherkin.Parsers.StepParser - def build_background(map, all_lines) do - {map, remaining_lines} = DescriptionParser.build_description(map, all_lines) - StepParser.build_background_steps(map, remaining_lines) + def build_background(map, all_lines, keywords) do + {map, remaining_lines} = DescriptionParser.build_description(map, all_lines, keywords) + StepParser.build_background_steps(map, remaining_lines, keywords) end end diff --git a/lib/gherkin/parsers/description_parser.ex b/lib/gherkin/parsers/description_parser.ex index a61aafd..7bcf331 100644 --- a/lib/gherkin/parsers/description_parser.ex +++ b/lib/gherkin/parsers/description_parser.ex @@ -1,16 +1,17 @@ defmodule Gherkin.Parsers.DescriptionParser do @moduledoc false - def build_description(map, [line |lines] = all_lines) do - if starts_with_keyword?(line.text) do + alias Gherkin.Keywords + + def build_description(map, [line | lines] = all_lines, keywords) do + if starts_with_keyword?(line.text, keywords) do {map, all_lines} else - build_description(%{map | description: map.description <> line.text <> "\n"}, lines) + build_description(%{map | description: map.description <> line.text <> "\n"}, lines, keywords) end end - @all_keywords ["@", "Feature", "Rule", "Background", "Example", "Scenario", ~s{"""}, "Given", "Then", "And", "But"] - defp starts_with_keyword?(line) do - String.starts_with?(line, @all_keywords) + def starts_with_keyword?(line, keywords) do + String.starts_with?(line, ["@", ~s{"""} | Keywords.get_description_keywords_list(keywords)]) end end diff --git a/lib/gherkin/parsers/feature_parser.ex b/lib/gherkin/parsers/feature_parser.ex index c9e7985..594c3b6 100644 --- a/lib/gherkin/parsers/feature_parser.ex +++ b/lib/gherkin/parsers/feature_parser.ex @@ -6,48 +6,82 @@ defmodule Gherkin.Parsers.FeatureParser do alias Gherkin.Parsers.ScenarioParser alias Gherkin.Parsers.RuleParser alias Gherkin.Parsers.TagParser + import Gherkin.Keywords, only: [match_keywords?: 2] + import Gherkin.Elements.Line, only: [get_line_name: 1] - def build_feature(feature, []) do + def build_feature(feature, [], _keywords) do %{feature | rules: Enum.reverse(feature.rules), scenarios: Enum.reverse(feature.scenarios)} end - def build_feature(feature, all_lines) do + def build_feature(feature, all_lines, keywords) do {tags, [line | remaining_lines]} = TagParser.process_tags(all_lines) - - case line do - %{text: "Feature: " <> name, line_number: line_number} = _ -> - updated_feature = %{feature | line: line_number, name: String.trim(name), tags: tags} - {updated_feature, remaining_lines} = DescriptionParser.build_description(updated_feature, remaining_lines) - build_feature(updated_feature, remaining_lines) - %{text: "Background:" <> _} = _ -> - {updated_feature, remaining_lines} = BackgroundParser.build_background(feature, remaining_lines) - build_feature(updated_feature, remaining_lines) - %{text: "Scenario:" <> scenario_name, line_number: line_number} = _ -> - build_scenario(scenario_name, line_number, tags, feature, remaining_lines) - %{text: "Example:" <> scenario_name, line_number: line_number} = _ -> - build_scenario(scenario_name, line_number, tags, feature, remaining_lines) - %{text: "Scenario Outline:" <> scenario_name, line_number: line_number} = _ -> - build_scenario_outline(scenario_name, line_number, tags, feature, remaining_lines) - %{text: "Scenario Template:" <> scenario_name, line_number: line_number} = _ -> - build_scenario_outline(scenario_name, line_number, tags, feature, remaining_lines) - %{text: "Rule:" <> rule_name, line_number: line_number} = _ -> - new_rule = %Gherkin.Elements.Rule{line: line_number, name: String.trim(rule_name), tags: tags} - {updated_rule, remaining_lines} = RuleParser.build_rule(new_rule, remaining_lines) - build_feature(%{feature | rules: [updated_rule | feature.rules]}, remaining_lines) - _ -> - raise("Unexpected line when building Feature: #{line.text}") + + cond do + String.contains?(line.text, ["language"]) -> + build_feature(feature, remaining_lines, keywords) + + match_keywords?(line.text, keywords.feature) -> + updated_feature = %{ + feature | + line: line.line_number, + name: line.text + |> get_line_name() + |> String.trim(), + tags: tags + } + {updated_feature, remaining_lines} = DescriptionParser.build_description( + updated_feature, + remaining_lines, + keywords + ) + build_feature(updated_feature, remaining_lines, keywords) + + match_keywords?(line.text, keywords.background) -> + {updated_feature, remaining_lines} = BackgroundParser.build_background(feature, remaining_lines, keywords) + build_feature(updated_feature, remaining_lines, keywords) + + match_keywords?(line.text, keywords.scenario_outline) -> + line.text + |> get_line_name() + |> build_scenario_outline(line.line_number, tags, feature, remaining_lines, keywords) + + match_keywords?(line.text, keywords.scenario) -> + line.text + |> get_line_name() + |> build_scenario(line.line_number, tags, feature, remaining_lines, keywords) + + match_keywords?(line.text, keywords.rule) -> + new_rule = %Gherkin.Elements.Rule{ + line: line.line_number, + name: line.text + |> get_line_name() + |> String.trim(), + tags: tags + } + {updated_rule, remaining_lines} = RuleParser.build_rule(new_rule, remaining_lines, keywords) + build_feature(%{feature | rules: [updated_rule | feature.rules]}, remaining_lines, keywords) + + true -> raise("Unexpected line when building Feature: #{line.text}") end end - defp build_scenario(scenario_name, line_number, tags, feature, remaining_lines) do + defp build_scenario(scenario_name, line_number, tags, feature, remaining_lines, keywords) do new_scenario = %Gherkin.Elements.Scenario{line: line_number, name: String.trim(scenario_name), tags: tags} - {updated_scenario, remaining_lines} = ScenarioParser.build_scenario(new_scenario, remaining_lines) - build_feature(%{feature | scenarios: [updated_scenario | feature.scenarios]}, remaining_lines) + {updated_scenario, remaining_lines} = ScenarioParser.build_scenario(new_scenario, remaining_lines, keywords) + build_feature(%{feature | scenarios: [updated_scenario | feature.scenarios]}, remaining_lines, keywords) end - defp build_scenario_outline(scenario_name, line_number, tags, feature, remaining_lines) do - new_scenario_outline = %Gherkin.Elements.ScenarioOutline{line: line_number, name: String.trim(scenario_name), tags: tags} - {updated_scenario_outline, remaining_lines} = ScenarioParser.build_scenario_outline(new_scenario_outline, remaining_lines) - build_feature(%{feature | scenarios: [updated_scenario_outline | feature.scenarios]}, remaining_lines) + defp build_scenario_outline(scenario_name, line_number, tags, feature, remaining_lines, keywords) do + new_scenario_outline = %Gherkin.Elements.ScenarioOutline{ + line: line_number, + name: String.trim(scenario_name), + tags: tags + } + {updated_scenario_outline, remaining_lines} = ScenarioParser.build_scenario_outline( + new_scenario_outline, + remaining_lines, + keywords + ) + build_feature(%{feature | scenarios: [updated_scenario_outline | feature.scenarios]}, remaining_lines, keywords) end end diff --git a/lib/gherkin/parsers/rule_parser.ex b/lib/gherkin/parsers/rule_parser.ex index a873db8..baecd6d 100644 --- a/lib/gherkin/parsers/rule_parser.ex +++ b/lib/gherkin/parsers/rule_parser.ex @@ -5,47 +5,52 @@ defmodule Gherkin.Parsers.RuleParser do alias Gherkin.Parsers.DescriptionParser alias Gherkin.Parsers.ScenarioParser alias Gherkin.Parsers.TagParser + import Gherkin.Keywords, only: [match_keywords?: 2] + import Gherkin.Elements.Line, only: [get_line_name: 1] @doc """ Given a Feature and the lines which form the Gherkin document, build a Rule. Returns the Feature with the built Rule added to its existing list of Rules. """ - def build_rule(rule, []), do: {%{rule | scenarios: Enum.reverse(rule.scenarios)}, []} - def build_rule(rule, all_lines) do - {updated_rule, remaining_lines} = DescriptionParser.build_description(rule, all_lines) + def build_rule(rule, [], _keywords), do: {%{rule | scenarios: Enum.reverse(rule.scenarios)}, []} + def build_rule(rule, all_lines, keywords) do + {updated_rule, remaining_lines} = DescriptionParser.build_description(rule, all_lines, keywords) {tags, [line | remaining_lines]} = TagParser.process_tags(remaining_lines) - - case line do - %{text: "Background:" <> _} = _ -> - {updated_rule, remaining_lines} = BackgroundParser.build_background(updated_rule, remaining_lines) - build_rule(updated_rule, remaining_lines) - %{text: "Scenario:" <> scenario_name, line_number: line_number} = _ -> - build_scenario(scenario_name, line_number, tags, updated_rule, remaining_lines) - %{text: "Example:" <> scenario_name, line_number: line_number} = _ -> - build_scenario(scenario_name, line_number, tags, updated_rule, remaining_lines) - %{text: "Scenario Outline:" <> scenario_name, line_number: line_number} = _ -> - build_scenario_outline(scenario_name, line_number, tags, updated_rule, remaining_lines) - %{text: "Scenario Template:" <> scenario_name, line_number: line_number} = _ -> - build_scenario_outline(scenario_name, line_number, tags, updated_rule, remaining_lines) - %{text: "Rule:" <> _} = _ -> + + cond do + match_keywords?(line.text, keywords.background) -> + {updated_rule, remaining_lines} = BackgroundParser.build_background(updated_rule, remaining_lines, keywords) + build_rule(updated_rule, remaining_lines, keywords) + + match_keywords?(line.text, keywords.scenario) -> + line.text + |> get_line_name() + |> build_scenario(line.line_number, tags, updated_rule, remaining_lines, keywords) + + match_keywords?(line.text, keywords.scenario_outline) -> + line.text + |> get_line_name() + |> build_scenario_outline(line.line_number, tags, updated_rule, remaining_lines, keywords) + + match_keywords?(line.text, keywords.rule) -> {%{updated_rule | scenarios: Enum.reverse(updated_rule.scenarios)}, all_lines} - _ -> - raise("Unexpected line: #{line.text}") + + true -> raise("Unexpected line: #{line.text}") end end - defp build_scenario(scenario_name, line_number, tags, rule, remaining_lines) do + defp build_scenario(scenario_name, line_number, tags, rule, remaining_lines, keywords) do new_scenario = %Gherkin.Elements.Scenario{line: line_number, name: String.trim(scenario_name), tags: tags} - {updated_scenario, remaining_lines} = DescriptionParser.build_description(new_scenario, remaining_lines) - {updated_scenario, remaining_lines} = ScenarioParser.build_scenario(updated_scenario, remaining_lines) - build_rule(%{rule | scenarios: [updated_scenario | rule.scenarios]}, remaining_lines) + {updated_scenario, remaining_lines} = DescriptionParser.build_description(new_scenario, remaining_lines, keywords) + {updated_scenario, remaining_lines} = ScenarioParser.build_scenario(updated_scenario, remaining_lines, keywords) + build_rule(%{rule | scenarios: [updated_scenario | rule.scenarios]}, remaining_lines, keywords) end - defp build_scenario_outline(scenario_name, line_number, tags, rule, remaining_lines) do + defp build_scenario_outline(scenario_name, line_number, tags, rule, remaining_lines, keywords) do new_scenario_outline = %Gherkin.Elements.ScenarioOutline{line: line_number, name: String.trim(scenario_name), tags: tags} - {updated_scenario_outline, remaining_lines} = DescriptionParser.build_description(new_scenario_outline, remaining_lines) - {updated_scenario_outline, remaining_lines} = ScenarioParser.build_scenario_outline(updated_scenario_outline, remaining_lines) - build_rule(%{rule | scenarios: [updated_scenario_outline | rule.scenarios]}, remaining_lines) + {updated_scenario_outline, remaining_lines} = DescriptionParser.build_description(new_scenario_outline, remaining_lines, keywords) + {updated_scenario_outline, remaining_lines} = ScenarioParser.build_scenario_outline(updated_scenario_outline, remaining_lines, keywords) + build_rule(%{rule | scenarios: [updated_scenario_outline | rule.scenarios]}, remaining_lines, keywords) end end diff --git a/lib/gherkin/parsers/scenario_parser.ex b/lib/gherkin/parsers/scenario_parser.ex index 2878e9a..5a77b22 100644 --- a/lib/gherkin/parsers/scenario_parser.ex +++ b/lib/gherkin/parsers/scenario_parser.ex @@ -1,20 +1,21 @@ defmodule Gherkin.Parsers.ScenarioParser do @moduledoc false + alias Gherkin.Keywords alias Gherkin.Parsers.DescriptionParser alias Gherkin.Parsers.TableParser alias Gherkin.Parsers.StepParser - def build_scenario(scenario, all_lines) do - {updated_scenario, remaining_lines} = DescriptionParser.build_description(scenario, all_lines) - StepParser.build_steps(updated_scenario, remaining_lines) + def build_scenario(scenario, all_lines, keywords) do + {updated_scenario, remaining_lines} = DescriptionParser.build_description(scenario, all_lines, keywords) + StepParser.build_steps(updated_scenario, remaining_lines, keywords) end - def build_scenario_outline(scenario_outline, all_lines) do - {updated_scenario_outline, remaining_lines} = DescriptionParser.build_description(scenario_outline, all_lines) - {updated_scenario_outline, [line | lines]} = StepParser.build_steps(updated_scenario_outline, remaining_lines) + def build_scenario_outline(scenario_outline, all_lines, keywords) do + {updated_scenario_outline, remaining_lines} = DescriptionParser.build_description(scenario_outline, all_lines, keywords) + {updated_scenario_outline, [line | lines]} = StepParser.build_steps(updated_scenario_outline, remaining_lines, keywords) - if is_outline_keyword?(line.text) do + if is_examples_keyword?(line.text, keywords) do {[header], table_lines} = Enum.split(lines, 1) {kv_pairs, remaining_lines} = TableParser.parse_table(header.text, table_lines) {%{updated_scenario_outline | examples: kv_pairs}, remaining_lines} @@ -23,7 +24,7 @@ defmodule Gherkin.Parsers.ScenarioParser do end end - defp is_outline_keyword?(text) do - String.trim(text) in ["Examples:", "Scenarios:"] + defp is_examples_keyword?(text, keywords) do + Keywords.match_keywords?(text, keywords.examples) end end diff --git a/lib/gherkin/parsers/step_parser.ex b/lib/gherkin/parsers/step_parser.ex index 622e2ba..3118d96 100644 --- a/lib/gherkin/parsers/step_parser.ex +++ b/lib/gherkin/parsers/step_parser.ex @@ -1,44 +1,45 @@ defmodule Gherkin.Parsers.StepParser do @moduledoc false + alias Gherkin.Keywords alias Gherkin.Elements.Step alias Gherkin.Parsers.TableParser alias Gherkin.Parsers.DocStringParser - def build_background_steps(map, all_lines) do - {steps, remaining_lines} = parse_steps(all_lines) + def build_background_steps(map, all_lines, keywords) do + {steps, remaining_lines} = parse_steps(all_lines, keywords) {%{map | background_steps: steps}, remaining_lines} end - def build_steps(map, all_lines) do - {steps, remaining_lines} = parse_steps(all_lines) + def build_steps(map, all_lines, keywords) do + {steps, remaining_lines} = parse_steps(all_lines, keywords) {%{map | steps: steps}, remaining_lines} end - defp parse_steps(steps \\ [], lines) - defp parse_steps(steps, []), do: {Enum.reverse(steps), []} - defp parse_steps(all_steps, [line | lines] = all_lines) do - part_list = String.split(line.text, " ", parts: 2) - - if is_step?(List.first(part_list)) do - new_step = %Step{keyword: List.first(part_list), text: List.last(part_list), line: line.line_number} - parse_steps([new_step | all_steps], lines) + defp parse_steps(steps \\ [], lines, keywords) + defp parse_steps(steps, [], _keywords), do: {Enum.reverse(steps), []} + defp parse_steps(all_steps, [line | lines] = all_lines, keywords) do + step_keywords_list = Keywords.get_step_keywords_list(keywords) + keyword = Keywords.find_keyword_from_list(line.text, step_keywords_list) + + if nil !== keyword do + text = line.text + |> String.replace_prefix(keyword, "") + |> String.trim + new_step = %Step{keyword: keyword, text: text, line: line.line_number} + parse_steps([new_step | all_steps], lines, keywords) else [step | steps] = all_steps case line.text do "|" <> text -> {kv_pairs, remaining_lines} = TableParser.parse_table(text, lines) - parse_steps([%{step | table_data: kv_pairs} | steps], remaining_lines) + parse_steps([%{step | table_data: kv_pairs} | steps], remaining_lines, keywords) ~s(""") <> _ -> {updated_step, remaining_lines} = DocStringParser.parse_doc_string(step, lines) - parse_steps([updated_step | steps], remaining_lines) + parse_steps([updated_step | steps], remaining_lines, keywords) _ -> {Enum.reverse(all_steps), all_lines} end end end - - defp is_step?(keyword) do - keyword in ["Given", "Then", "When", "And", "But"] - end end diff --git a/mix.exs b/mix.exs index 30c7e95..de3e81b 100644 --- a/mix.exs +++ b/mix.exs @@ -41,7 +41,8 @@ defmodule Gherkin.Mixfile do defp deps do [ {:ex_doc, "~> 0.18", only: :dev}, - {:earmark, "~> 1.2", only: :dev} + {:earmark, "~> 1.2", only: :dev}, + {:jason, "~> 1.1"} ] end diff --git a/mix.lock b/mix.lock index da8bc52..f5ae5aa 100644 --- a/mix.lock +++ b/mix.lock @@ -1,2 +1,5 @@ -%{"earmark": {:hex, :earmark, "1.2.3", "206eb2e2ac1a794aa5256f3982de7a76bf4579ff91cb28d0e17ea2c9491e46a4", [:mix], [], "hexpm"}, - "ex_doc": {:hex, :ex_doc, "0.18.1", "37c69d2ef62f24928c1f4fdc7c724ea04aecfdf500c4329185f8e3649c915baf", [:mix], [{:earmark, "~> 1.1", [hex: :earmark, repo: "hexpm", optional: false]}], "hexpm"}} +%{ + "earmark": {:hex, :earmark, "1.2.3", "206eb2e2ac1a794aa5256f3982de7a76bf4579ff91cb28d0e17ea2c9491e46a4", [:mix], [], "hexpm"}, + "ex_doc": {:hex, :ex_doc, "0.18.1", "37c69d2ef62f24928c1f4fdc7c724ea04aecfdf500c4329185f8e3649c915baf", [:mix], [{:earmark, "~> 1.1", [hex: :earmark, repo: "hexpm", optional: false]}], "hexpm"}, + "jason": {:hex, :jason, "1.1.2", "b03dedea67a99223a2eaf9f1264ce37154564de899fd3d8b9a21b1a6fd64afe7", [:mix], [{:decimal, "~> 1.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm"}, +} diff --git a/test/gherkin/parser_test.exs b/test/gherkin/parser_test.exs index a37033b..e79c9cf 100644 --- a/test/gherkin/parser_test.exs +++ b/test/gherkin/parser_test.exs @@ -41,6 +41,19 @@ defmodule Gherkin.ParserTest do Then I should be served a coffee """ + @feature_in_french_text """ + # language: fr + Fonctionnalité: Servir le café + Le café ne doit pas être servie avant d'être payé + Le café ne doit pas être servie avant que le bouton soit pressé + S'il n'y a plus de café l'argent doit être remboursé + + Scénario: Acheter le dernier café + Etant donné qu'il n'y a plus qu'un café dans la machine + Et que j'ai déposé 1$ + Quand je presse le bouton + Alors je dois avoir un café + """ @feature_with_single_feature_tag """ @beverage Feature: Serve coffee @@ -249,6 +262,29 @@ defmodule Gherkin.ParserTest do assert expected_steps == steps end + test "Reads a feature in a different language" do + expected_steps = [ + %Step{keyword: "Etant donné qu'", text: "il n'y a plus qu'un café dans la machine", line: 8}, + %Step{keyword: "Et que", text: "j'ai déposé 1$", line: 9}, + %Step{keyword: "Quand", text: "je presse le bouton", line: 10}, + %Step{keyword: "Alors", text: "je dois avoir un café", line: 11} + ] + + assert %Feature{ + name: name, + description: description, + scenarios: [%{steps: steps} | _], + line: 2 + } = parse_feature(@feature_in_french_text) + assert name == "Servir le café" + assert description == """ + Le café ne doit pas être servie avant d'être payé + Le café ne doit pas être servie avant que le bouton soit pressé + S'il n'y a plus de café l'argent doit être remboursé + """ + assert steps == expected_steps + end + test "Reads a table in to the correct step" do exptected_table_data = [ %{:"Column one" => "Hello", :"Column two" => "World"} @@ -292,7 +328,8 @@ defmodule Gherkin.ParserTest do test "file streaming" do assert %Gherkin.Elements.Feature{} = - File.stream!("test/gherkin/parser/coffee.feature") |> parse_feature() + File.stream!("test/gherkin/parser/coffee.feature") + |> parse_feature() end test "Reads a feature with a single tag" do @@ -313,6 +350,6 @@ defmodule Gherkin.ParserTest do end test "Reads a feature with multiple rules" do - assert %{rules: [%Rule{}, %Rule{}]} = parse_feature(@feature_with_multiple_rules) + assert %{rules: [%Rule{}, %Rule{}]} = parse_feature(@feature_with_multiple_rules) end end