Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 315c51b

Browse filesBrowse files
committed
Mentioned the extraction of translation contents from PHP files
1 parent 21198dc commit 315c51b
Copy full SHA for 315c51b

File tree

1 file changed

+12
-10
lines changed
Filter options

1 file changed

+12
-10
lines changed

‎translation.rst

Copy file name to clipboardExpand all lines: translation.rst
+12-10Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -357,23 +357,26 @@ with these tasks:
357357

358358
.. code-block:: terminal
359359
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
361361
$ php bin/console translation:update --dump-messages --force fr
362362
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.
365374

366375
.. note::
367376

368377
If you want to see the missing translation strings without actually updating
369378
the translation files, remove the ``--force`` option from the command above.
370379

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-
377380
.. _translation-resource-locations:
378381

379382
Translation Resource/File Names and Locations
@@ -564,4 +567,3 @@ Learn more
564567
.. _`ISO 639-1`: https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes
565568
.. _`Translatable Extension`: http://atlantic18.github.io/DoctrineExtensions/doc/translatable.html
566569
.. _`Translatable Behavior`: https://github.com/KnpLabs/DoctrineBehaviors
567-
.. _`TranslationBundle`: https://github.com/php-translation/symfony-bundle

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.