Skip to content

Enhance BDD support (GIVEN/WHEN/THEN) for French language #5150

Description

@orenault

Hi,

According to the Gherkin Syntax, there's a lot of ways to translate the BDD keywords in French.
Cf: https://cucumber.io/docs/gherkin/languages/

As an exemple, GIVEN => 16 possibilities

image

Currently, only one seems implemented in Robot Framework: 'Étant donné'

This has impacts:

  • emphasis on capital letter is not easy to type
  • this involves sometimes to midy the name of the step so that the general meaning of the sentence is correct

To resolves this, will it be possible to implements all the possibilities ?
Or at least "Etant donné", "Etant donné que", "Étant donné que".

Regards

Activity

  1. pekkaklarck commented on Jul 21, 2024

    @pekkaklarck
    Member

    Updating French localization is certainly possibly. Some questions/comments related to that:

    • Should also other BDD prefixes be updated?
    • Is this something that should be discussed with the larger French speaking Robot Framework community? There's such discussion going on within the Dutch community (Updates to Dutch translations #5148), but updating BDD prefixes to comply with the spec you referred to may not need much discussion. Assuming the original prefixes are preserved, this change would also be fully backwards compatible.
    • Are you willing to create a pull request with the needed updates? The class to edit is here.
  2. leeuwe commented on Aug 2, 2024

    @leeuwe
    Member

    Each BDD prefix is already a list, so this should be easy
    @orenault As Pekka mentioned you can provide a PR yourself, updating those strings.
    You can reach out to me if you run into questions.

  3. pekkaklarck commented on Nov 13, 2024

    @pekkaklarck
    Member

    Are you @orenault interested to implement this?

    @leeuwe, should we consider updating all languages so that they match https://cucumber.io/docs/gherkin/languages/?

  4. orenault commented on Nov 13, 2024

    @orenault
    ContributorAuthor

    Hi, I'm still interested to see this to be implemented.
    Really busy at work (and at home) these days, so can't do it myself currently.
    If nobody else can do, I will..

  5. omn32 commented on Jan 29, 2025

    @omn32

    Hello @orenault, je peux t'aider si tu prends le lead, je suis pas dev mais si besoin je suis dispo. Olivier (Mtp)

  6. omn32 commented on Feb 10, 2025

    @omn32

    Hello @leeuwe, I'm not developper but if I send you the "languages.py" updated.
    Can you create the PULL REQUEST for the next release ?

  7. leeuwe commented on Feb 10, 2025

    @leeuwe
    Member

    @omn32 If you can upload it as a public file somewhere on GitHub, I can do that - sure!

  8. orenault commented on Feb 10, 2025

    @orenault
    ContributorAuthor

    Hello @orenault, je peux t'aider si tu prends le lead, je suis pas dev mais si besoin je suis dispo. Olivier (Mtp)

    Hello. Desolé, pas vu ce message avant. Ok, je peux faire la review puis la pr. Envoie moi le fichier par mail. C'est mon nom de user at gmail.

  9. omn32 commented on Feb 10, 2025

    @omn32

    Hello everyone,
    I just sent a Languages.py file to @orenault with french section updated, like this:

    given_prefixes = ['Soit', 'Sachant', 'Sachant que', "Sachant qu'", 'Étant donné', 'Étant donné que', "Etant donné qu'"]
    when_prefixes = ['Quand', 'Lorsque', "Lorsqu'"]
    then_prefixes = ['Alors', 'Donc']
    and_prefixes = ['Et', 'Et que', "Et qu'"]
    but_prefixes = ['Mais', 'Mais que', "Mais qu'"]
    
  10. leeuwe commented on Feb 10, 2025

    @leeuwe
    Member

    So do I get from that that @orenault will make a PR? If so, please mention issue in the PR!

  11. omn32 commented on Feb 10, 2025

    @omn32

    So do I get from that that @orenault will make a PR? If so, please mention issue in the PR!

    Yes @orenault will make the PR.

  12. orenault commented on Feb 11, 2025

    @orenault
    ContributorAuthor

    Yes, will add few values, test all, then do a PR (with omn32 credits).

  13. orenault commented on Feb 13, 2025

    @orenault
    ContributorAuthor

    Hi !
    Unfortunatly, I've made the change on my local installation (RF 7.1.1) and I have flaky tests.

    Seems the issue is in the core, and I can't troubleshoot this.

    @leeuwe
    Can you try on your own ?

    In conf\language.py, (line 559?), just replace:

    given_prefixes = ['Étant donné']
    

    by:

    given_prefixes = ['Étant donné', 'Étant donné que']
    

    Then use this TC:
    Cas de test en francais
    [Tags] FR
    Étant donné NO OPERATION
    Étant donné que NO OPERATION

    Some times all is PASS, sometimes FAIL as can't find one of the Gherkin prefix.

    No keyword with name 'Étant donné que NO OPERATION' found.

    (and if I add more prefix, the FAIL will be randomly on the prefix list)
    For me, seems a 'bug' in the core. Maybe linked with the use of accents ?

    Regards
    Olivier

  14. omn32 commented on Feb 13, 2025

    @omn32
  15. orenault commented on Feb 13, 2025

    @orenault
    ContributorAuthor

    I don't think so.
    I must clarify: this behaviour is observed on windows, I did not tried on linux.

  16. orenault commented on Feb 13, 2025

    @orenault
    ContributorAuthor

    Same behaviour on Ubuntu (WSL) & RF 7.2.2
    Use language: fr & language: en at the beginning of the TC, but using only language: fr gives same results.

  17. orenault commented on Feb 17, 2025

    @orenault
    ContributorAuthor

    Hi, I've made the PR to fix the bug (#5340), and to add the BDD prefix in French:
    given_prefixes = ['Étant donné', 'Étant donné que', "Étant donné qu'", 'Soit', 'Sachant que', "Sachant qu'", 'Sachant', 'Etant donné', 'Etant donné que', "Etant donné qu'", 'Etant donnée', 'Etant données']
    when_prefixes = ['Lorsque', 'Quand', "Lorsqu'"]
    then_prefixes = ['Alors', 'Donc']
    and_prefixes = ['Et', 'Et que', "Et qu'"]
    but_prefixes = ['Mais', 'Mais que', "Mais qu'"]

    More 'Given' can be added later (as there is a lot of variations in French) but it should be enough to cover most of the needs (use directly Use Cases written in a TMS, to implement RF TCs directly without rewrite the Gherkin).

  18. added this to the v7.3 milestone on Feb 27, 2025
  19. added
    acknowledge
    on Feb 27, 2025
  20. added a commit that references this issue on Mar 7, 2025
    341ae48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    acknowledgeeffort: smallpriority: mediumrc 1

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions