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

Other languages does not work #44

Closed
dcsg opened this issue Jul 28, 2011 · 8 comments
Closed

Other languages does not work #44

dcsg opened this issue Jul 28, 2011 · 8 comments

Comments

@dcsg
Copy link
Contributor

dcsg commented Jul 28, 2011

Hi,

I just start using behat today, and tried it with the "pt" language. For what i read in doc's i have to change the "en" keywords for the specific language i want to use, but the problem is it throws an exception:

exception

[Behat\Gherkin\Exception\ParserException]                                                                 
Expected Feature token, but got Text on line: 1 in file: /www2/behatmink/features/ls.feature 

My code:

behat.yml

default:
    formatter:
        parameters:
            language: 'pt' 

features/ls.feature

Funcionalidade: ls
    Ver a estrutura de uma directoria
    Como um utilizador UNIX
    É preciso listar o conteudo da directoria

Cenario: Listar 2 ficheiros da directoria
    Dado Eu estar na directoria "test"
    E tenho o ficheiro "foo"
    E o ficheiro "bar"
    Quando corro "ls"
    Entao devo obter:
        """
        bar
        foo
        """

Note: It translates the "passed", "example" and this stuff the only thing doesn't work is the keywords translation

@arendjantetteroo
Copy link
Contributor

You need to add the following to the top of your feature files to use another language,otherwise behat assumes it's in english :

language: pt

@dcsg
Copy link
Contributor Author

dcsg commented Jul 28, 2011

i didn't see that in doc's, now is working! i will read again the docs and make a PR with it if the doc's does not mention it ;)

@dcsg dcsg closed this as completed Jul 28, 2011
@arendjantetteroo
Copy link
Contributor

I had the same problem 2 days ago, see http://groups.google.com/group/behat/browse_thread/thread/93d0ab611e90d7b1
A PR for the docs would be nice.

@dcsg dcsg reopened this Jul 28, 2011
@dcsg
Copy link
Contributor Author

dcsg commented Jul 28, 2011

But it doesn't make sense, the language is set to "pt" in behat.yml it should work without the reference inside the feature file or not @everzet?

@everzet
Copy link
Member

everzet commented Jul 28, 2011

No it should not. The language, that you specify in behat.yml or with parameter is the language of Behat formatter (output generator) - that's why it's placed under formatter section of configs. This option doesn't affect Gherkin parser.

Features are explicit pieces of information, that could and should be used separately from Behat in many cases. Keeping this in mind, hiding some important information (like language) from them in Behat configs is the true crime!

Also, single project could have features in multiple languages ;-) And english is used by default.

@everzet everzet closed this as completed Jul 28, 2011
@everzet
Copy link
Member

everzet commented Jul 28, 2011

@dcsg
Copy link
Contributor Author

dcsg commented Jul 28, 2011

@everzet you are more faster than me, i was just about to do a PR on that ;) tks

@ftassi
Copy link

ftassi commented Jun 11, 2013

behat-docs repo has been moved. Just for reference, here is the correct link to the patch https://github.com/Behat/en-docs.behat.org/commit/c1f76bf

wouterj pushed a commit to wouterj/Behat that referenced this issue Jul 1, 2014
Implements saveScreenshot helper method in MinkContext
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

No branches or pull requests

4 participants