-
-
Notifications
You must be signed in to change notification settings - Fork 731
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: allow gherkin keywords as supported by cucumber #4784
Conversation
hi @ebo-zig actually, we are not only translating gherkin keywords, but also the codeceptjs actions are translated as well, so that's why there is now separated file for each language, for instance https://github.com/codeceptjs/CodeceptJS/blob/3.x/translations/de-DE.js |
Scenario: gherkinTranslations[langCode].scenario[0], | ||
ScenarioOutline: gherkinTranslations[langCode].scenarioOutline[0], | ||
}, | ||
actions: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ebo-zig may you help review this translation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done! Came to the conclusion that the Dutch language is a little bit strange after reviewing this 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Haha, yeah, I could imagine that as I asked help from chatgpt to translate them. Thanks for the review!
Hi @kobenguyent, I agree with the fact that not only Gherkin keywords should be translated. But re-defining the Gherkin translations feels a little bit duplicate to me. So, if that is what we want, then that is allright. |
May you happen to have any better approaches for this? |
I think there are two possible solutions:
The con of 1 is that using BDD tests in CodeceptJS doesn't work out of the box. And we are defining what already is defined by Cucumber. So there is no better approach IMO, other than chosing between the possible solutions. |
thanks for your input! |
Thank you! This looks really cool |
@kobenguyent is there any chance this change will be available soon in a new tag? |
@ebo-zig I could not say for certain when there would be a release, but of course, you could try |
Motivation/Description of the PR
Because managing translations of Gherkin keywords happens in this repo, the features cannot be run in every language. When setting the language of the feature to Dutch (nl), CodeceptJS threats it as English.
Therefore, the translations of keywords should be loaded from Cucumber: https://github.com/cucumber/gherkin/blob/main/javascript/src/gherkin-languages.json
Type of change
Checklist:
npm run docs
)npm run lint
)npm test
)