Fix #1: analyze localized (non-English) feature files - #3
Merged
Conversation
Structural Gherkin keywords (Feature/Background/Scenario/Scenario Outline/ Examples) were hardcoded English and the `# language:` header was never read, so a localized feature file (e.g. `# language: de` with Szenario:, Beispiele:) was silently under-parsed: its scenarios were not counted and its Examples table was never found, which also broke data-error (undefined-placeholder) detection. - Add GherkinDialect + GherkinDialectProvider, backed by the canonical gherkin-languages.json (vendored from cucumber/gherkin, embedded as a resource). The provider reads the `# language:` header (English if absent). - Route DuplicateAnalyzer's block/step keyword checks through the dialect. English files keep using the configured StepKeywords (unchanged behavior); localized files use their dialect's keywords. - Make GherkinNarrativeGuard + StepDefinitionCoverageAnalyzer dialect-aware (block-boundary + case-sensitive step-keyword matching per dialect). - Tests: German file scenarios counted + undefined placeholder detected; English regression (undefined placeholder still detected); embedded-resource load; coverage path matches a German step and rejects German narrative prose. Note: using the canonical `en` table means English now also recognizes the standard Gherkin synonyms (Example:, Scenarios:) — more spec-correct, and no sample-corpus collisions. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Records source, upstream commit SHA, and cucumber/gherkin's MIT license, and ships it in the NuGet package. Required since the data file is embedded and redistributed via the packed tool. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Karzone
added a commit
that referenced
this pull request
Jul 24, 2026
Fix #1: analyze localized (non-English) feature files
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1.
Problem
Structural Gherkin keywords (
Feature:/Background:/Scenario:/Scenario Outline:/Examples:) were hardcoded English and the# language:header was never read. A localized feature file — e.g.# language: dewithSzenario:,Beispiele:— was silently under-parsed: its scenarios weren't counted and itsBeispiele:table was never found, which broke undefined-placeholder (data-error) detection too.Change
GherkinDialect+GherkinDialectProvider, backed by the canonicalgherkin-languages.json(vendored from cucumber/gherkin, embedded as a resource). The provider reads the# language:header, defaulting to English when absent.DuplicateAnalyzer,GherkinNarrativeGuard, andStepDefinitionCoverageAnalyzerthrough the dialect. Step-keyword matching stays case-sensitive per dialect (faithful to the real Gherkin parser).StepKeywords(unchanged); localized files use their dialect's keywords.Behavior note (intended)
Using the canonical
entable means English now also recognizes the standard Gherkin synonymsExample:andScenarios:. This is more spec-correct and has no collisions with the sample corpus. Issue #1's acceptance criteria were updated to match.Tests — 225 pass (6 new, 219 existing, 0 regressions)
# language:header detectionLicensing
gherkin-languages.jsonis MIT (cucumber/gherkin). Since it's embedded and shipped in the packed NuGet tool,THIRD-PARTY-NOTICES.mdrecords the source, exact upstream commit SHA, and MIT license text, and is packed into the package.🤖 Generated with Claude Code