Setting @Ignore to fully ignore the string#194
Setting @Ignore to fully ignore the string#194ollietb wants to merge 7 commits intoschmittjoh:masterfrom
Conversation
|
👍 @ollietb Could you retrigger travis? |
|
@hacfi I think I need to be the owner to retrigger travis. |
|
@ollietb No..just add a new commit. For example remove a blank line in the |
|
what happened to this ? i think this is a good integration when will it be merged with the master branch ? |
|
politely ping @schmittjoh :) |
|
Cool @ollietb. Thank you for this PR. Would you mind rebasing this on master? |
|
@Nyholm is this still needed? |
|
I politely ask you the same question. =) The two referenced tickets are closed. I was not familiar with the code base at the time you first made this PR. What I really want to know is if you have time and interest if updating the PR and push it through a review process? If not we can close this for now until someone picks ut up. |
|
@Nyholm Yep I can do it, I was just making sure that this hadn't been done by someone else in another PR |
|
@Nyholm I've updated the PR |
|
When testing this with the following code in a controller: $form = $this->createFormBuilder();
$form->add('status','choice', [
'choices' => [
"1" => 'Yes',
"0" => 'No'
],
'required' => false,
]);I get following result: <trans-unit id="356a192b7913b04c54574d18c28d46e6395428ab" resname="1">
<source>1</source>
<target state="new">1</target>
<jms:reference-file line="26">/Users/tobias/Workspace/PHPStorm/SymfonyBundle/app/../src/AppBundle/Controller/DefaultController.php</jms:reference-file>
</trans-unit>With the current dev-master I get <trans-unit id="b6589fc6ab0dc82cf12099d1c2d40ab994e8410c" resname="0">
<source>0</source>
<target state="new">0</target>
<jms:reference-file line="27">/Users/tobias/Workspace/PHPStorm/SymfonyBundle/app/../src/AppBundle/Controller/DefaultController.php</jms:reference-file>
</trans-unit>
<trans-unit id="356a192b7913b04c54574d18c28d46e6395428ab" resname="1">
<source>1</source>
<target state="new">1</target>
<jms:reference-file line="26">/Users/tobias/Workspace/PHPStorm/SymfonyBundle/app/../src/AppBundle/Controller/DefaultController.php</jms:reference-file>
</trans-unit>Without any ignore this is not fetching all my translations. |
| $this->assertEquals($expected, $this->extract('MyAuthException.php')); | ||
| $extracted = $this->extract('MyAuthException.php'); | ||
|
|
||
| $this->assertFalse($extracted->getDomains()['authentication']->has('security.authentication_error.ignored')); |
There was a problem hiding this comment.
This is not supported in PHP5.3
|
@Nyholm is there a test for that controller code? I can't seem to see it in the tests? |
I think the default behaviour for @ignore is misleading. It sounds like it should ignore the whole string, not just the error message. This PR adds the ability to @ignore a string in a Controller or FormType class. I don't currently see a way of implementing for twig yet.
Fixes #162 and #20