Skip to content

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

Closed
vladimirkl opened this Issue Feb 1, 2012 · 1 comment

2 participants

@vladimirkl

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
Cucumber member

Yes, please do!

@vladimirkl vladimirkl added a commit to vladimirkl/cucumber-jvm that referenced this issue Feb 1, 2012
@vladimirkl vladimirkl Fixed issue #184 - i18n java snippets for undefined steps are always …
…generated with @Given annotation
b25faf5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.