You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Given/When/Then should support other languages than English #519
Originally submitted to Google Code by Andreas.EbbertKarroum on 30 Mar 2010
When issue 500 is implemented, it would be nice to supply with the
[Template] keyword not only the test case that should be used, but also, in
what language that template is written.
When I say
[Template] User Login en
RF will ignode prefixes "Given", "When", "Then", and "And" from keywords.
When I specify another language, like "de", then "Gegeben", "Wenn", "Dann",
and "Und".
It would be nice to have this kind of support but I'm not sure is [Template] setting
from issue 500 the best solution for configuration. I would rather make it possible
to specify the used languages from the command line. I doubt you normally have that
many languages in one execution round that there would be problems. This would also
be relatively simple to implement so if you Andreas are interested help we can
include this to RF 2.5.
Since Andreas is willing to help I think we can safely include this to 2.5. My
proposed solution is this:
Include BDD prefixes of some languages into the framework. We can, for example,
send a mail to rf-users and ask people what languages they would like to be included.
Alternatively we can look at prefixes Cucumber supports.
Allow selecting the languages to use from the command line e.g. like --bddprefixes en:de. English can probably be the default for backwards compatibility.
Allow also custom prefixes to support special customization and languages not yet
included in the core. I think we can use the same option as in 2) for this like: --bddprefixes Gegeben_Wenn_Dann_Und_Sauerkraut.
If you Andreas are willing to write the documentation to the User Guide I can
implement and test this.
Originally submitted to Google Code by jan.zdunek on 21 Jun 2012
Hi Robot Developers!
Do you still plan to do something about this issue? 2.7.3 has been released and the situation is unchanged. The workaround found by Andreas (please see comment #3) has IMHO two drawbacks:
Keyword substitution clutters your log file. The built-in English BDD prefixes are eliminated silently keeping the log tidy.
Keyword substitution doesn't work smoothly with keywords from test libraries if those kw require arguments. Using such kw with the built-in English BDD prefixes is no problem.
From this point of view a clean support of i18n BDD prefix would be preferrable. And I'd like to offer my support for the implementation as well ;-)
Regards
Jan Zdunek
Senior Consultant - codecentric AG
Originally submitted to Google Code by jan.zdunek on 26 Jul 2012
Please find attached a prototype implementation of what has been sketched out in the previous comments.
I utilized the command line options "-B" and "--bddprefixes", both followed by the desired language code. Currently en|EN for English and de|DE for German are support. Please see the given atest for details how to use it. Anybody providing additional languages?
The default behaviour when skipping the option is using the english prefixes as in the current release. The focus was to keep Robot's behaviour unchanged when the option is not used. Thus both English prefixes and the keyword substitution approach Andreas mentioned above shall work fine as long as you don't apply the new cli options.
Currently not supported is the idea of giving the prefixes at the commandline. And I haven't touched the documentation yet.
I put the prefixes in the class BddPrefixes (bddprefixes.py) just because it seems to be the only option working with the "one jar" distribution form of the Robot Framework. I'd be more than happy to provide all prefixes in a dedicated configuration file if somebody has an idea how to get this running when everything is in just one jar...
I've done some testing with real life test suite but additional testing is highly welcome!
I'd be happy if you have a look at the patch and send me your remarks!
Regards
Jan Zdunek
Senior Consultant - codecentric AG
I would like to see some kind of support for non-English prefixes already in RF 2.8.2. A simple solution would be adding --bddprefixes or --gherkinprefixes option that just takes a list of prefixes to ignore. This ought to be easy to implement and would also support any possible language.
A drawback would be that using it would be a bit cumbersome, but it would be possible to create a start-up script that sets needed prefixes. A configuration file where default values for options like this could be defined would be really handy, but that's too much work for RF 2.8.2. A simpler idea, something that could be done in 2.8.2, is reading additional command line options from ROBOT_OPTIONS environment variable. You could, for example, define that environment variable so that it contains --BddPrefixes gegeben:wenn:dann:und:außerdem:sei. How would that sound?
Needing to specify the prefixes isn't as convenient than just selecting the language. The best way to implement that would probably be using Cucumber's "official" Gherkin prefixes somehow. That's too much work for RF 2.8.2, though, and we probably would anyway need a way to use custom prefixes.
My proposal is:
Implement a way to specify what prefixes to ignore when matching keywords. Use current Given/When/Then/And by default. Open questions:
What option name? --BddPrefix, --GherkinPrefix, or something else? I like the latter more but don't have a strong opinion. Notice that these options are always case-insensitive.
Should the specified prefixes be used in addition or instead of the default prefixes? I think instead is better, the default prefixes can be specified explicitly if needed.
Add support for reading command line options from an environment variable. This requires a separate issue. Open questions:
What variable name ROBOT_OPTIONS, ROBOT_CLI_OPTIONS, or something else? I prefer the former.
Should these options be first or last in the real argument list? I think first, because then they can be overwritten by options from the command line.
Issue #1566 covers adding ROBOT_OPTIONS and REBOT_OPTIONS. That is a generally useful feature and will be included in 2.8.2 regardless what is done to this issue.
This would be a really useful feature. BDD tests/scenarios are basically software specifications that should be written in a domain specific language that all stakeholders understand very well. English is not always the best choice for that. Many other BDD tools already support multiple languages (cucumber, behat, etc). Hopefully we get language support also for robot framework soon.
Yes, this would be a nice feature. Getting it in just requires someone needing it badly enough to either provide a pull request or sponsoring the developement.
We decided to move this one and highly related multilanguage markers issue (#4096) to RF 5.1. That wasn't done because we don't consider these issues important, on the contrary, but simply because RF 5.0 already contains lot of great new features and we want to get it out as soon as possible. These translation related issues will be the highest priority issues in RF 5.1 and the plan is to start its development right after RF 5.0 has been released.
What's the status of this? Is robot going to adopt the custom resolver solution so that we can provide our own functions for resolving keyword names, or are translations going to be built into the core? I sure hope the more general solution is supported so we can provide our own translations fairly simply.
See this comment for issue #4096 for a list of everything that can be translated in RF 5.1, including the BDD prefixes that are covered by this issue. With these prefixes it's probably a good idea to look at what terms Cucumber uses.
We obviously need help with translations from the community. We have decided to use the #localization channel on our Slack as the main collaboration forum and separate channels can be created for each language there as well. If you are interested to help but haven't yet joined out Slack community, you can get an invite here.
Activity
spooning commentedon Jun 29, 2014
It would be nice to have this kind of support but I'm not sure is [Template] setting
from issue 500 the best solution for configuration. I would rather make it possible
to specify the used languages from the command line. I doubt you normally have that
many languages in one execution round that there would be problems. This would also
be relatively simple to implement so if you Andreas are interested help we can
include this to RF 2.5.
spooning commentedon Jun 29, 2014
command line option would also be ok. Of course I'm offering my help for features I'm
interested in getting done :)
spooning commentedon Jun 29, 2014
Workaround found :)
http://blog.codecentric.de/en/2010/04/fachtests-mit-dem-robot-framework-in-der-muttersprache-schreiben/
spooning commentedon Jun 29, 2014
Since Andreas is willing to help I think we can safely include this to 2.5. My
proposed solution is this:
Include BDD prefixes of some languages into the framework. We can, for example,
send a mail to rf-users and ask people what languages they would like to be included.
Alternatively we can look at prefixes Cucumber supports.
Allow selecting the languages to use from the command line e.g. like
--bddprefixes en:de. English can probably be the default for backwards compatibility.Allow also custom prefixes to support special customization and languages not yet
included in the core. I think we can use the same option as in 2) for this like:
--bddprefixes Gegeben_Wenn_Dann_Und_Sauerkraut.If you Andreas are willing to write the documentation to the User Guide I can
implement and test this.
spooning commentedon Jun 29, 2014
We need to get 2.5 (or RC) out in May and we don't have time to implement
this.
If this is urgent to you and you want to help to get this done, we may
reconsider inclusion.
spooning commentedon Jun 29, 2014
In order to keep 2.6 manageable, the core team will not implement this for 2-6
spooning commentedon Jun 29, 2014
Hi Robot Developers!
Do you still plan to do something about this issue? 2.7.3 has been released and the situation is unchanged. The workaround found by Andreas (please see comment #3) has IMHO two drawbacks:
From this point of view a clean support of i18n BDD prefix would be preferrable. And I'd like to offer my support for the implementation as well ;-)
Regards
Jan Zdunek
Senior Consultant - codecentric AG
spooning commentedon Jun 29, 2014
Please find attached a prototype implementation of what has been sketched out in the previous comments.
I utilized the command line options "-B" and "--bddprefixes", both followed by the desired language code. Currently en|EN for English and de|DE for German are support. Please see the given atest for details how to use it. Anybody providing additional languages?
The default behaviour when skipping the option is using the english prefixes as in the current release. The focus was to keep Robot's behaviour unchanged when the option is not used. Thus both English prefixes and the keyword substitution approach Andreas mentioned above shall work fine as long as you don't apply the new cli options.
Currently not supported is the idea of giving the prefixes at the commandline. And I haven't touched the documentation yet.
I put the prefixes in the class BddPrefixes (bddprefixes.py) just because it seems to be the only option working with the "one jar" distribution form of the Robot Framework. I'd be more than happy to provide all prefixes in a dedicated configuration file if somebody has an idea how to get this running when everything is in just one jar...
I've done some testing with real life test suite but additional testing is highly welcome!
I'd be happy if you have a look at the patch and send me your remarks!
Regards
Jan Zdunek
Senior Consultant - codecentric AG
spooning commentedon Jun 29, 2014
Issue 1545 has been merged into this issue.
spooning commentedon Jun 29, 2014
I would like to see some kind of support for non-English prefixes already in RF 2.8.2. A simple solution would be adding
--bddprefixesor--gherkinprefixesoption that just takes a list of prefixes to ignore. This ought to be easy to implement and would also support any possible language.A drawback would be that using it would be a bit cumbersome, but it would be possible to create a start-up script that sets needed prefixes. A configuration file where default values for options like this could be defined would be really handy, but that's too much work for RF 2.8.2. A simpler idea, something that could be done in 2.8.2, is reading additional command line options from ROBOT_OPTIONS environment variable. You could, for example, define that environment variable so that it contains
--BddPrefixes gegeben:wenn:dann:und:außerdem:sei. How would that sound?Needing to specify the prefixes isn't as convenient than just selecting the language. The best way to implement that would probably be using Cucumber's "official" Gherkin prefixes somehow. That's too much work for RF 2.8.2, though, and we probably would anyway need a way to use custom prefixes.
My proposal is:
Implement a way to specify what prefixes to ignore when matching keywords. Use current Given/When/Then/And by default. Open questions:
What option name? --BddPrefix, --GherkinPrefix, or something else? I like the latter more but don't have a strong opinion. Notice that these options are always case-insensitive.
Should the specified prefixes be used in addition or instead of the default prefixes? I think instead is better, the default prefixes can be specified explicitly if needed.
Add support for reading command line options from an environment variable. This requires a separate issue. Open questions:
What variable name ROBOT_OPTIONS, ROBOT_CLI_OPTIONS, or something else? I prefer the former.
Should these options be first or last in the real argument list? I think first, because then they can be overwritten by options from the command line.
spooning commentedon Jun 29, 2014
Issue #1566 covers adding ROBOT_OPTIONS and REBOT_OPTIONS. That is a generally useful feature and will be included in 2.8.2 regardless what is done to this issue.
spooning commentedon Jun 29, 2014
The doesn't seem to be that much interest related to this functionality. Descoping from 2.8.2 in order to get that release out sooner.
keskiju commentedon May 24, 2016
This would be a really useful feature. BDD tests/scenarios are basically software specifications that should be written in a domain specific language that all stakeholders understand very well. English is not always the best choice for that. Many other BDD tools already support multiple languages (cucumber, behat, etc). Hopefully we get language support also for robot framework soon.
pekkaklarck commentedon May 24, 2016
Yes, this would be a nice feature. Getting it in just requires someone needing it badly enough to either provide a pull request or sponsoring the developement.
felipecaputo commentedon Sep 1, 2017
I believe I can help with it.
Has anyone defined how it should work? maybe like this or maybe support all of the Gherkin translations defined in any configuration
I've liked the ideia of the command line argument too, maybe using a list of languages
--bddprefixes en,pt-br,de,fr25 remaining items
pekkaklarck commentedon Jan 17, 2022
We decided to move this one and highly related multilanguage markers issue (#4096) to RF 5.1. That wasn't done because we don't consider these issues important, on the contrary, but simply because RF 5.0 already contains lot of great new features and we want to get it out as soon as possible. These translation related issues will be the highest priority issues in RF 5.1 and the plan is to start its development right after RF 5.0 has been released.
boakley commentedon Apr 13, 2022
What's the status of this? Is robot going to adopt the custom resolver solution so that we can provide our own functions for resolving keyword names, or are translations going to be built into the core? I sure hope the more general solution is supported so we can provide our own translations fairly simply.
MoreFamed commentedon May 23, 2022
Adding myself to the issue...
pekkaklarck commentedon May 24, 2022
See this comment for issue #4096 for a list of everything that can be translated in RF 5.1, including the BDD prefixes that are covered by this issue. With these prefixes it's probably a good idea to look at what terms Cucumber uses.
We obviously need help with translations from the community. We have decided to use the
#localizationchannel on our Slack as the main collaboration forum and separate channels can be created for each language there as well. If you are interested to help but haven't yet joined out Slack community, you can get an invite here.Support localized BDD-prefixes (#519)
Better error handling with --language files. #4096 #519
pekkaklarck commentedon Jul 6, 2022
This issue can be considered done. We still need to add the actual translations and document this stuff, but they are both covered by #4390.