2

I use JMS Translation Bundle (https://github.com/schmittjoh/JMSTranslationBundle) in a project.

I have this function, which return me a array, with @Ignore before each label. But JMS generate translation key even if the @Ignore is present.

private function getStatusSelect()
{        
    return array(
        "URLverify"=>array(
            'label' => /** @Ignore */'Certificates left',
            'url'   => $this->generateUrl('admin_liste_verif_ready'),
        ),          
        "URLlistToAccept"=>array(
            'label' => /** @Ignore */'List to accept',
            'url'   => $this->generateUrl('admin_liste_verif'),
        ),
        "URLaccepted"=>array(
            'label' => /** @Ignore */'Accepted',
            'url'   => $this->generateUrl('admin_liste_index_accepted_action'),
        ),
        "URLrejected"=>array(
            'label' => /** @Ignore */'Rejected',
            'url'   => $this->generateUrl('admin_liste_index_rejected_action'),
        ),                        
    );
}

In lot of another places in my code @Ignore is perfectly working, but not in this case.

Do you know why ?

Thanks to you

Bouffe

Bouffe
  • 770
  • 13
  • 37

1 Answers1

2

I always thought that you should add this before the key. JMSTranslationBundle looks for the "label" key and tries to extract a translation from it. (the same with the key "choices"). Try the following:

private function getStatusSelect()
{        
    return array(
        "URLverify" => array(
            /** @Ignore */
            'label' => 'Certificates left',
            'url'   => $this->generateUrl('admin_liste_verif_ready'),
        ),
        // ...
    );
}