cucumber-attic / gherkin2

A fast Gherkin parser in Ragel (The parser behind Cucumber)
MIT License
382 stars 221 forks source link

Support i18n in snippet generation #319

Closed snorripall closed 9 years ago

snorripall commented 9 years ago

The Icelandic language always gets generated to this.Given

I'm using cucumber-js version 0.4.4 which uses gherkin 2.12.2 https://github.com/cucumber/cucumber-js/blob/v0.4.4/package.json

Example

For this feature

# language: is
Eiginleiki: Example feature
  My story

  Atburðarás: Should be scenario
    Ef should be given
    Þegar should be when
    Þá should be then
    Og should be then
    En should be then

I get the following output when I run cucumber-js.

this.Given(/^should be given$/, function (callback) {
  // Write code here that turns the phrase above into concrete actions
  callback.pending();
});

this.Given(/^should be when$/, function (callback) {
  // Write code here that turns the phrase above into concrete actions
  callback.pending();
});

this.Given(/^should be then$/, function (callback) {
  // Write code here that turns the phrase above into concrete actions
  callback.pending();
});

Expected output should be

this.Given(/^should be given$/, function (callback) {
  // Write code here that turns the phrase above into concrete actions
  callback.pending();
});

this.When(/^should be when$/, function (callback) {
  // Write code here that turns the phrase above into concrete actions
  callback.pending();
});

this.Then(/^should be then$/, function (callback) {
  // Write code here that turns the phrase above into concrete actions
  callback.pending();
});
aslakhellesoy commented 9 years ago

The title of this ticket is "Error parsing Icelandic in JS version", but reading the description it sounds like the bug isn't about parsing, but about snippet generation.

Did you expect this instead?

this.Ef(/^should be given$/, function (callback) {
  // Write code here that turns the phrase above into concrete actions
  callback.pending();
});

If so, maybe change the title of this issue to something like "Support i18n in snippet generation"?

snorripall commented 9 years ago

Right you are! Fixed and updated.

Thanks :)

snorripall commented 9 years ago

Does this perhaps belong to cucumber-js rather than gherkin?

See last comment: https://github.com/cucumber/cucumber-js/issues/34

snorripall commented 9 years ago

Closing this as it belongs to cucumber-js