Remember earlier we said that you can write your Gherkin features in the spoken language of your stakeholders? Here’s how.
Putting a # language: comment on the first line of a feature file tells Cucumber which spoken language that feature is written in. If you omit this header, Cucumber will default to English, as you’ve already seen.
Here’s an example of a feature written in Norwegian:
|||# language: no|
|||For å unngå at firmaet går konkurs|
|||Må regnskapsførere bruke en regnemaskin for å legge sammen tall|
|||Scenario: to tall|
|||Gitt at jeg har tastet inn 5|
|||Og at jeg har tastet inn 7|
|||Når jeg summerer|
|||Så skal resultatet være 12|
If you’re wondering whether Cucumber knows how to speak your language, ...