extentreports-csharp icon indicating copy to clipboard operation
extentreports-csharp copied to clipboard

How to generate report file with Japanese SpecFlow keyword (Given, when, then, ...)

Open duy123a opened this issue 1 year ago • 1 comments

I try to generate a Japanese report but no idea how to do that

What I haved tried

I am using .NET 8 with SpecFlow The feature file is Japanese (followed this keyword https://github.com/cucumber/gherkin/blob/main/gherkin-languages.json)

var sparkReporter = new ExtentSparkReporter(...) _extentReports = new ExtentReports(); _extentReports.GherkinDialect = "ja"; _extentReports.AttachReporter(sparkReporter);

...

_feature = _extentReports.CreateTest( new GherkinKeyword(Feature.Name.MapToLocaleKeyword()), // change "Feature" to "フィーチャ" FeatureContext.FeatureInfo.Title, string.Empty);

...

_extentReports.Flush();

But the report file still have SpecFlow keyword as English

Can you help me about that. Thanks

duy123a avatar Jan 09 '24 09:01 duy123a

@duy123a Hi, I checked it in the mater branch, but it is displayed normally in Japanese.

master branch <PackageVersion>5.0.3-beta</PackageVersion>

  _path = DateTime.Now.Millisecond + FileName;

  _extent = new ExtentReports();
  _spark = new ExtentSparkReporter(_path);

  _spark.Config.Theme = AventStack.ExtentReports.Reporter.Config.Theme.Dark;
  _extent.GherkinDialect = "ja";

  _extent.AttachReporter( _spark);

_extent.CreateTest(new GherkinKeyword("フィーチャ"), // change "Feature" to "フィーチャ"
"フィーチャ  ",
 string.Empty);
_extent.Flush();

image

namilkimfree avatar Apr 19 '24 07:04 namilkimfree