Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add gettext support #306

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

dutradda
Copy link

@dutradda dutradda commented Jun 28, 2019

First translation was written for portuguese, according to https://cucumber.io/docs/gherkin/reference/#spoken-languages.

The PR also enables the language reset during runtime.

@dutradda dutradda force-pushed the gettext-support branch 7 times, most recently from 520a559 to e24265b Compare June 28, 2019 16:40
@dutradda
Copy link
Author

@youtux, @olegpidsadnyi and @sliwinski-milosz

Hello guys,
can any of you take a look on my PR?

I have to change the tox/travis settings because the pytest 4.5 and after are crashing the tests.

@coveralls
Copy link

coveralls commented Jun 28, 2019

Coverage Status

Coverage increased (+0.07%) to 93.615% when pulling 4a52482 on dutradda:gettext-support into 72a8764 on pytest-dev:master.

@sliwinski-milosz
Copy link
Contributor

Travis has been fixed on master so you can revert your travis related changes

@dutradda
Copy link
Author

@sliwinski-milosz
code updated

@olegpidsadnyi
Copy link
Contributor

To be honest I don't really understand why do we need gettext for 11 keywords. This seems like an overkill. Another point is the current language. I think this should be a pytest option that the plugin introduces.

@olegpidsadnyi
Copy link
Contributor

The whole point is to be compatible with the cucumber? To let people use pytetst instead of cucumber? Then the language support is like this:
https://cucumber.io/docs/gherkin/reference/#spoken-languages

#language header, and only keywords. There's no need in gettext. This is just a simple dict lookup once the header is set on the feature file. Otherwise english.

See https://github.com/cucumber/gherkin-python/blob/master/gherkin/gherkin-languages.json

@youtux
Copy link
Contributor

youtux commented Aug 2, 2019

Maybe we should instead import and use gherkin and delegate the parsing of feature files to this library, provided by cucumber.io.
If we use that, we will have automatic support for all the languages, and issues like #311 would probably not exist, or they would have to be fixed by the upstream.

@dutradda
Copy link
Author

dutradda commented Aug 2, 2019

@olegpidsadnyi and @youtux
How we can proceed?

I really want to see multiple languages support on pytest-bdd. We already written the feature files in portuguese here. And the Gherkin language recommends that.

I can change my PR to fit the needs of the project.
But I need to know the next steps.

@youtux
Copy link
Contributor

youtux commented Aug 2, 2019

@dutradda, if you are willing to work on this, I would propose to continue in this way:

  1. add the dependency gherkin-official to this project
  2. parse feature files with that library, instead of having our own parsing logic

I am not sure how much work it would require, but I think it is a viable option.

@dutradda
Copy link
Author

dutradda commented Aug 2, 2019

@youtux
I'll do it and keep you informed

@jsa34
Copy link
Collaborator

jsa34 commented Sep 22, 2024

@youtux is this still relevant/needed?

@youtux
Copy link
Contributor

youtux commented Sep 22, 2024

@youtux is this still relevant/needed?

Now that we use the official parser it should come out of the box. #698

maybe we should add a test though to make sure that everything work fine when using a feature file in a different language

@jsa34
Copy link
Collaborator

jsa34 commented Sep 22, 2024

Good point. I've got a few other issues that just need asserting and tests to close them. I'll add this to them

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants