I am using JMSTranslationBundle
(v1.1.0) to extract translation keys from my source but for an unknown reason (I have been searching why for the past 4 hours - really), the script can't find the placeholder
text. It finds: validation messages, translatable strings in templates, text in PHP Forms... well everything as it should EXCEPT placeholder
texts. I checked the JMSTranslationBundle repository, and this is a feature that was added more than 9 months ago with no actual issues about this.
Here is an example:
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder->add('password', 'repeated', array(
'first_name' => 'password',
'second_name' => 'confirm',
'type' => 'password',
'invalid_message' => 'user.auth.password.invalidMessage',
'first_options' => array(
'label' => 'user.auth.password.password.label'
),
'second_options' => array(
'label' => 'user.auth.password.confirmation.label'
),
'options' => array(
'label_attr' => array(
'class' => 'control-label'
),
'attr' => array(
'placeholder' => 'user.auth.password.password.placeholder'
)),
));
}
The script will find:
user.auth.password.invalidMessage
,
user.auth.password.password.label
and
user.auth.password.confirmation.label
But it won't find user.auth.password.password.placeholder
I have no errors in the log files, nothing showing up with the verbose mode (-vvv
) so I don't know where to look.
Here is the command line I'm using (just in case it comes from the command line):
php app/console translation:extract --env=dev --keep --bundle=AcmeMyBundle --output-dir=./src/Acme/MyBundle/Resources/translations/ en
If you need more info, please ask in the comments, I'll be happy to provide them.
Thank you so much for your help !