robotframework
robotframework copied to clipboard
Enhance BDD support (GIVEN/WHEN/THEN) for French language
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
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
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 (#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.
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.
Are you @orenault interested to implement this?
@leeuwe, should we consider updating all languages so that they match https://cucumber.io/docs/gherkin/languages/?
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..
Hello @orenault, je peux t'aider si tu prends le lead, je suis pas dev mais si besoin je suis dispo. Olivier (Mtp)
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 ?
@omn32 If you can upload it as a public file somewhere on GitHub, I can do that - sure!
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.
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'"]
So do I get from that that @orenault will make a PR? If so, please mention issue in the PR!
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.
Yes, will add few values, test all, then do a PR (with omn32 credits).
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
Olivier, il faut pas mettre des " double ' quand tu as des apostrophe et mot clef de plus de 1 motExemple "Et que" ou "Etant qu'"
Yahoo Mail : Recherchez, organisez, maîtrisez
Le jeu., févr. 13, 2025 à 17:11, Olivier @.***> a écrit:
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
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***> orenault left a comment (robotframework/robotframework#5150) 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
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>
I don't think so. I must clarify: this behaviour is observed on windows, I did not tried on linux.
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.
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).