Behave - Supported Languages

We have the option to utilise other languages apart from English in the feature file. This is because, the majority of BDD tools have the support for internationalisation. The important fact is that the keywords - Then, When, Given can be described in other native languages like Spanish, French, and so on.

In that case, the developer can implement the step definitions in other languages as well. The list of all the languages can be obtained with the command: behave --lang-list.

The following screen will appear on your computer after using the command behave --lang-list

Supported Languages

Some more languages included in Behave are mentioned below −

Particular Language

A feature file can be associated with a particular language. At this time, the BDD framework chooses the keywords for that specific language. The language can be set as default in the configuration file.

Behave configuration files can be either, .behaverc or behave.ini files. The value for the parameter lang should be set to da in the configuration file, if we want the language to be to Danish.

Configuration file setup

The feature file set up for selecting a particular language is given below and the language used as an example is Danish (da).

lang = da