Comments (3)
Thanks for your contributions @HDelpr and @tulavalle in raising - have added some initial documentation on gherkin localisation to the README arising from your issues. π
This would be a SpecFlow deviation rather than Cucumber.
An initial observation is that the Cucumber localisation documentation was copied over to SpecFlow documentation without the necessary information to indicate incompatibilities; SpecFlow dialects documentation states:
Note Big parts of this page where taken over from https://cucumber.io/docs/gherkin/reference/.
The Cucumber ecosystem (including this extension) adhere to the keys for spoken languages in the Cucumber gherkin parser repository - which the localisation documentation is created from. Note, it does not contain an
nl-NL
,en-US
orpt-BR
key. For example, using thenl
key specified in the localisation documentation will work for you:# language: nl Functionaliteit: Rekenmachine @mytag Scenario: twee getallen optellen Stel I have an "expression" En het tweede getal 70 is Als de twee getallen opgeteld zijn Dan is het resultaat 120
In the SpecFlow Configuration Elements documentation, building on the aforementioned gherkin localisation documentation, they "recommend using specific culture names (e.g.: βen-USβ) rather than generic (neutral) cultures (e.g.: βenβ)" - this appears to be driven by how SpecFlow is implemented. This SpecFlow deviation is not supported by the gherkin parser and will raise a parsing error, see below example:
from gherkin.parser import Parser from gherkin.pickles.compiler import Compiler parser = Parser() gherkin_document = parser.parse( """ # language: nl-NL Functionaliteit: Rekenmachine """ ) pickles = Compiler().compile(gherkin_document)... gherkin.errors.CompositeParserException: Parser errors: (2:1): Language not supported: nl-NL
Actions
Considering the extension supports the gherkin spoken languages localisation, I have closed the issue. However I was wondering @HDelpr/@tulavalle whether you can advise if not following the 'recommendation' of SpecFlow of using 'specific culture names' has any impact on your SpecFlow testing i.e. using the global names such as
en
,nl
andpt
? If no issue, the extension should be compatible with your gherkin and also with SpecFlow testing by using those keys.Otherwise, I would suggest to open an issue with SpecFlow to support the keys from the gherkin localisation documentation; or alternatively to raise an issue on the gherkin parser repository to support additional specific culture keys.
Hope this provides some clarity, but please comment if any queries, etc. There is definitely scope to improve documentation on this topic for both Cucumber and SpecFlow so interested in any thoughts. Cheers!
The added documentation regarding the required settings helped resolve the issue. All you had to do was apply them in settings.json. As I use Specflow, the language configuration was being done by specflow.json. After configuration, for the extension to identify the feature files, it was enough to include the language indication in each file "*.feature. In the case of Brazilian Portuguese, specifying (pt-BR) does not work, however, leaving it generic I was able to use the extension without problems: "# language: pt". Another one did it, thanks for your attention @kieran-ryan!
from vscode.
Thanks for your contributions @HDelpr and @tulavalle in raising - have added some initial documentation on gherkin localisation to the README arising from your issues. π
This would be a SpecFlow deviation rather than Cucumber.
An initial observation is that the Cucumber localisation documentation was copied over to SpecFlow documentation without the necessary information to indicate incompatibilities; SpecFlow dialects documentation states:
Note Big parts of this page where taken over from https://cucumber.io/docs/gherkin/reference/.
The Cucumber ecosystem (including this extension) adhere to the keys for spoken languages in the Cucumber gherkin parser repository - which the localisation documentation is created from. Note, it does not contain an nl-NL
, en-US
or pt-BR
key. For example, using the nl
key specified in the localisation documentation will work for you:
# language: nl
Functionaliteit: Rekenmachine
@mytag
Scenario: twee getallen optellen
Stel I have an "expression"
En het tweede getal 70 is
Als de twee getallen opgeteld zijn
Dan is het resultaat 120
In the SpecFlow Configuration Elements documentation, building on the aforementioned gherkin localisation documentation, they "recommend using specific culture names (e.g.: βen-USβ) rather than generic (neutral) cultures (e.g.: βenβ)" - this appears to be driven by how SpecFlow is implemented. This SpecFlow deviation is not supported by the gherkin parser and will raise a parsing error, see below example:
from gherkin.parser import Parser
from gherkin.pickles.compiler import Compiler
parser = Parser()
gherkin_document = parser.parse(
"""
# language: nl-NL
Functionaliteit: Rekenmachine
"""
)
pickles = Compiler().compile(gherkin_document)
...
gherkin.errors.CompositeParserException: Parser errors:
(2:1): Language not supported: nl-NL
Actions
Considering the extension supports the gherkin spoken languages localisation, I have closed the issue. However I was wondering @HDelpr/@tulavalle whether you can advise if not following the 'recommendation' of SpecFlow of using 'specific culture names' has any impact on your SpecFlow testing i.e. using the global names such as en
, nl
and pt
? If no issue, the extension should be compatible with your gherkin and also with SpecFlow testing by using those keys.
Otherwise, I would suggest to open an issue with SpecFlow to support the keys from the gherkin localisation documentation; or alternatively to raise an issue on the gherkin parser repository to support additional specific culture keys.
Hope this provides some clarity, but please comment if any queries, etc. There is definitely scope to improve documentation on this topic for both Cucumber and SpecFlow so interested in any thoughts. Cheers!
from vscode.
Thanks for the valuable feedback @tulavalle! If you encounter further issues or have any feature request ideas while using the extension, feel free to raise and we'll take a look. Thanks! π
from vscode.
Related Issues (20)
- WANTED: More maintainers π§πββοΈππΎββοΈππΌ HOT 2
- Cross-platform development scripts HOT 3
- Simplifying Development: A Return to Monorepo Architecture HOT 2
- Generate step definition does not work HOT 4
- Reindexing schedules on every "Go to Definition" HOT 4
- Recommend support for cucumber.js test runner HOT 3
- Concatenated step definition patterns and `@And` annotation unsupported in Java HOT 7
- In Python, all steps in Scenarios show as undefined, even for plain text matchers HOT 8
- Steps marked undefined in Cypress project HOT 3
- Steps undefined with Ruby `And` and `But` step definitions HOT 4
- Server initialization failed. HOT 10
- Cucumber fails to start in VSCode with Cucumber Language Server client: couldn't create connection to server error HOT 1
- Improve Cucumber Glue HOT 1
- No space between step keywords and step text in Korean dialect HOT 1
- Request for formatting options and textmate grammar HOT 1
- Consecutive Rules are nested in the outline panel HOT 1
- After login to Microsoft Azure AD, unable to redirect back to base URL HOT 2
- Scope paths where step definition snippets are generated HOT 5
- Cucumber on working on windows WSL HOT 1
- Undefined step using simple Go example HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vscode.