Internationalization 黄瓜/小黄瓜的翻译在哪里?
我想把这个小黄瓜的故事翻译成法语Internationalization 黄瓜/小黄瓜的翻译在哪里?,internationalization,cucumber,cucumber-jvm,gherkin,Internationalization,Cucumber,Cucumber Jvm,Gherkin,我想把这个小黄瓜的故事翻译成法语 Feature: Test the validation on the person object Background: Given the language is 'english' Scenario: Create a person with firstName empty and check we have a violation error message on it Given we create a new person
Feature: Test the validation on the person object
Background:
Given the language is 'english'
Scenario: Create a person with firstName empty and check we have a violation error message on it
Given we create a new person
And we set firstName ''
And we set lastName 'smith'
When we apply validation
Then we should have 1 violation
And we should have a error message on 'firstName' that says 'may not be empty'
但我不知道背景的翻译在哪里,我(偶然)发现Java@Etantdonné中的注释(类似于@Given)实际上在功能文件中使用了一个空格:“Etantdonné”
我在cucumber网站的文档中找不到这一点
有人能给我一个链接来了解如何在cucumber/gherkin中使用i18n吗?查看可用语言列表
列出特定语言的关键字
法语。如果省略此标题,Cucumber将默认为英语(en)
通过这种方式,您的功能将保存有关其内容类型的所有信息,这对于BDD等方法非常重要,并且还使Cucumber
能够在一个套件中拥有多语言功能
所有的小黄瓜单词都被翻译了
例如,法语:
- 场景-
Scénario
- 情景大纲-
战略计划或战略计划
- 然后-
Alors
- 当-
Quand
- 和-
Et que
- 但是-
Mais que
希望它能帮助您……当然,对于Java,您需要一个完整的命令行:Java-cp“jars/*”cucumber.api.cli.Main--i18n fr(其中“jars/*”是cucumber/Gherkin jars所在的文件夹)非常完美,谢谢。我把你的答案写在@MichaelSource上,太好了!!如何做到这一点?使用您的github帐户,只需继续该项目并在wiki上创建一个页面。亲爱的@MichaelSource,我已经修改了Cucumber wiki。现在检查一下。
> cucumber --i18n help
> cucumber --i18n <language_code>
> cucumber --i18n fr
# language: fr
**Fonctionnalité: ...**
...
fr: {
and: [
"* ",
"Et que ",
"Et qu'",
"Et "
],
background: [
"Contexte"
],
but: [
"* ",
"Mais que ",
"Mais qu'",
"Mais "
],
examples: [
"Exemples"
],
feature: [
"Fonctionnalité"
],
given: [
"* ",
"Soit ",
"Etant donné que ",
"Etant donné qu'",
"Etant donné ",
"Etant donnée ",
"Etant donnés ",
"Etant données ",
"Étant donné que ",
"Étant donné qu'",
"Étant donné ",
"Étant donnée ",
"Étant donnés ",
"Étant données "
],
name: "French",
native: "français",
scenario: [
"Scénario"
],
scenarioOutline: [
"Plan du scénario",
"Plan du Scénario"
],
then: [
"* ",
"Alors "
],
when: [
"* ",
"Quand ",
"Lorsque ",
"Lorsqu'"
]
},