@@ -357,23 +357,26 @@ with these tasks:
357
357
358
358
.. code-block :: terminal
359
359
360
- # updates the French translation file with the missing strings found in templates/
360
+ # updates the French translation file with the missing strings for that locale
361
361
$ php bin/console translation:update --dump-messages --force fr
362
362
363
- # updates the English translation file with the missing strings found in AppBundle
364
- $ php bin/console translation:update --dump-messages --force en AppBundle
363
+ The ``translation:update `` command looks for missing translations in:
364
+
365
+ * Templates stored in any of the directories defined in the
366
+ :ref: `twig.paths <config-twig-paths >` config option;
367
+ * Any PHP file/class that injects or :doc: `autowires </services/autowiring >` the
368
+ ``translator `` service and makes calls to the ``trans() `` function.
369
+
370
+ .. versionadded :: 4.3
371
+
372
+ The extraction of missing translation strings from PHP files was introduced
373
+ in Symfony 4.3.
365
374
366
375
.. note ::
367
376
368
377
If you want to see the missing translation strings without actually updating
369
378
the translation files, remove the ``--force `` option from the command above.
370
379
371
- .. tip ::
372
-
373
- If you need to extract translation strings from other sources, such as
374
- controllers, forms and flash messages, consider using the more advanced
375
- third-party `TranslationBundle `_.
376
-
377
380
.. _translation-resource-locations :
378
381
379
382
Translation Resource/File Names and Locations
@@ -564,4 +567,3 @@ Learn more
564
567
.. _`ISO 639-1` : https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes
565
568
.. _`Translatable Extension` : http://atlantic18.github.io/DoctrineExtensions/doc/translatable.html
566
569
.. _`Translatable Behavior` : https://github.com/KnpLabs/DoctrineBehaviors
567
- .. _`TranslationBundle` : https://github.com/php-translation/symfony-bundle
0 commit comments