Skip to content

Given/When/Then should support other languages than English #519

Closed

Description

@spooning

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".

This has already been briefly discussed in the user group:
http://groups.google.com/group/robotframework-users/browse_thread/thread/488c5bc04ab2315d/7f81d5b118e7aa7a?lnk=gst&q=german#7f81d5b118e7aa7a

Activity

  1. spooning commented on Jun 29, 2014

    @spooning
    ContributorAuthor

    Originally submitted to Google Code by @pekkaklarck on 30 Mar 2010

    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.

  2. spooning commented on Jun 29, 2014

    @spooning
    ContributorAuthor

    Originally submitted to Google Code by Andreas.EbbertKarroum on 31 Mar 2010

    command line option would also be ok. Of course I'm offering my help for features I'm
    interested in getting done :)

  3. spooning commented on Jun 29, 2014

    @spooning
    ContributorAuthor

    Originally submitted to Google Code by @pekkaklarck on 7 Apr 2010

    Since Andreas is willing to help I think we can safely include this to 2.5. My
    proposed solution is this:

    1. 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.

    2. 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.

    3. 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.

  4. spooning commented on Jun 29, 2014

    @spooning
    ContributorAuthor

    Originally submitted to Google Code by @yanne on 26 May 2010

    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.

  5. spooning commented on Jun 29, 2014

    @spooning
    ContributorAuthor

    Originally submitted to Google Code by @yanne on 27 Apr 2011

    In order to keep 2.6 manageable, the core team will not implement this for 2-6

  6. spooning commented on Jun 29, 2014

    @spooning
    ContributorAuthor

    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:

    1. Keyword substitution clutters your log file. The built-in English BDD prefixes are eliminated silently keeping the log tidy.
    2. 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

  7. spooning commented on Jun 29, 2014

    @spooning
    ContributorAuthor

    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

  8. spooning commented on Jun 29, 2014

    @spooning
    ContributorAuthor

    Originally submitted to Google Code by @pekkaklarck on 4 Nov 2013

    Issue 1545 has been merged into this issue.

  9. spooning commented on Jun 29, 2014

    @spooning
    ContributorAuthor

    Originally submitted to Google Code by @pekkaklarck on 4 Nov 2013

    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:

    1. 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.

    2. 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.

  10. spooning commented on Jun 29, 2014

    @spooning
    ContributorAuthor

    Originally submitted to Google Code by @pekkaklarck on 6 Nov 2013

    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.

  11. spooning commented on Jun 29, 2014

    @spooning
    ContributorAuthor

    Originally submitted to Google Code by @pekkaklarck on 19 Nov 2013

    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.

  12. keskiju commented on May 24, 2016

    @keskiju

    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.

  13. pekkaklarck commented on May 24, 2016

    @pekkaklarck
    Member

    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.

  14. felipecaputo commented on Sep 1, 2017

    @felipecaputo

    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,fr

  15. 25 remaining items

  16. modified the milestones: v5.0, v5.1 on Jan 17, 2022
  17. pekkaklarck commented on Jan 17, 2022

    @pekkaklarck
    Member

    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.

  18. boakley commented on Apr 13, 2022

    @boakley

    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.

  19. MoreFamed commented on May 23, 2022

    @MoreFamed

    Adding myself to the issue...

  20. pekkaklarck commented on May 24, 2022

    @pekkaklarck
    Member

    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.

  21. added a commit that references this issue on Jun 22, 2022
  22. pekkaklarck commented on Jul 6, 2022

    @pekkaklarck
    Member

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions