JMSTranslationBundle icon indicating copy to clipboard operation
JMSTranslationBundle copied to clipboard

Setting @Ignore to fully ignore the string

Open ollietb opened this issue 12 years ago • 13 comments

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

ollietb avatar Apr 14 '14 14:04 ollietb

:+1:

@ollietb Could you retrigger travis?

hacfi avatar Jun 21 '14 23:06 hacfi

@hacfi I think I need to be the owner to retrigger travis.

ollietb avatar Jul 11 '14 10:07 ollietb

@ollietb No..just add a new commit. For example remove a blank line in the usage.rst file.

hacfi avatar Jul 11 '14 10:07 hacfi

what happened to this ? i think this is a good integration when will it be merged with the master branch ?

Aaike avatar Nov 05 '14 05:11 Aaike

politely ping @schmittjoh :)

hacfi avatar Nov 05 '14 07:11 hacfi

Cool @ollietb. Thank you for this PR.

Would you mind rebasing this on master?

Nyholm avatar Mar 24 '16 13:03 Nyholm

@Nyholm is this still needed?

ollietb avatar Jul 07 '16 14:07 ollietb

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 avatar Jul 07 '16 14:07 Nyholm

@Nyholm Yep I can do it, I was just making sure that this hadn't been done by someone else in another PR

ollietb avatar Jul 14 '16 15:07 ollietb

@Nyholm I've updated the PR

ollietb avatar Jul 22 '16 17:07 ollietb

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.

Nyholm avatar Aug 04 '16 19:08 Nyholm

@Nyholm is there a test for that controller code? I can't seem to see it in the tests?

ollietb avatar Aug 17 '16 14:08 ollietb

Any updates on this or has it been abandoned @Nyholm @ollietb

peschee avatar Sep 16 '16 08:09 peschee