Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Mentioned the extraction of translation contents from PHP files#11598

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
Closed
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletionsreference/configuration/twig.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -301,6 +301,8 @@ on. Set it to ``0`` to disable all the optimizations. You can even enable or
disable these optimizations selectively, as explained in the Twig documentation
about `the optimizer extension`_.

.. _config-twig-default-path:

default_path
~~~~~~~~~~~~

Expand Down
23 changes: 13 additions & 10 deletionstranslation.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -357,23 +357,27 @@ with these tasks:

.. code-block:: terminal

# updates the French translation file with the missing stringsfound in templates/
# updates the French translation file with the missing stringsfor that locale
$ php bin/console translation:update --dump-messages --force fr

# updates the English translation file with the missing strings found in AppBundle
$ php bin/console translation:update --dump-messages --force en AppBundle
The ``translation:update`` command looks for missing translations in:

* Templates stored in the ``templates/`` directory (or any other directory
defined in the :ref:`twig.default_path <config-twig-default-path>` and
:ref:`twig.paths <config-twig-paths>` config options);
* Any PHP file/class that injects or :doc:`autowires </service_container/autowiring>`
the ``translator`` service and makes calls to the ``trans()`` function.

.. versionadded:: 4.3

The extraction of missing translation strings from PHP files was introduced
in Symfony 4.3.

.. note::

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

.. tip::

If you need to extract translation strings from other sources, such as
controllers, forms and flash messages, consider using the more advanced
third-party `TranslationBundle`_.

.. _translation-resource-locations:

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

[8]ページ先頭

©2009-2025 Movatter.jp