How to detect missing or unused translations from SonataAdmin bundle?
There is a nice tool in Symfony, to track missing/unused translations:
php bin/console debug:translation en AppBundle
However it can not recognize translations from SonataAdmin form field labels. When I run the command, response is:
---------- ---------- ------------------------------ ----------------------
State Domain Id Message Preview (en)
---------- ---------- ------------------------------ ----------------------
unused messages app.treasure_type.form.title Treasure
---------- ---------- ------------------------------ ----------------------
It should say that translation is used, because actually it's used and is working fine:
$formMapper
->add('title', null, [
'label' => 'app.treasure_type.form.title',
]);
translation file in src/AppBundle/Resources/translations/messages.en.yml
app.treasure_type.form.title: "Treasure"
configuration in app/config/config.yml
parameters:
locale: en
framework:
translator: { fallbacks: ['%locale%'] }