Skip to content

i18n java snippets for undefined steps are always generated with @Given annotation #184

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

Closed
vladimirkl opened this issue Feb 1, 2012 · 2 comments

Comments

@vladimirkl
Copy link
Contributor

Latest snapshot of cucumber-jvm 1.0.0.RC14-SNAPSHOT generates i18n java snippets for undefined steps with @given annotation only. I use "#language=ru" comments in feature files and never get snippets with annotations from "cucumber.annotation.ru" package. Actually this was never working due to following code in cucumber.runtime.UndefinedStepsTracker.java:

   private boolean isGivenWhenThenKeyword(String keyword, Locale locale) {
        I18n i18n = new I18n("en");
        for (String gwts : asList("given", "when", "then")) {
            List<String> keywords = i18n.keywords(gwts);
            if (keywords.contains(keyword) && !"* ".equals(keyword)) {
                return true;
            }
        }
        return false;
    }

So if we change first line to "I18n i18n = new I18n(locale.getLanguage())" everything works correctly. Should I create patch for this issue?

@aslakhellesoy
Copy link
Contributor

Yes, please do!

vladimirkl added a commit to vladimirkl/cucumber-jvm that referenced this issue Feb 1, 2012
@lock
Copy link

lock bot commented Oct 25, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Oct 25, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants