Skip to content

Commit 4e83e9a

Browse files
committed
minor #20352 Add --prefix and --no-fill to translation page (jawira)
This PR was merged into the 7.2 branch. Discussion ---------- Add --prefix and --no-fill to translation page I added documentation for `--no-fill` option and `--prefix` option in Translations page. `--no-fill` option is a new feature in Symfony 7.2. Closes #20343 Commits ------- b8e5d0c Add --prefix and --no-fill to translation page
2 parents 019d505 + b8e5d0c commit 4e83e9a

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

translation.rst

+25
Original file line numberDiff line numberDiff line change
@@ -467,8 +467,33 @@ The ``translation:extract`` command looks for missing translations in:
467467
468468
$ composer require nikic/php-parser
469469
470+
By default, the ``translation:extract`` command extracts new messages in
471+
*message/translation* pairs, with the translation populated with the same
472+
text as the message, prefixed by ``__``. You can customize this prefix using
473+
the ``--prefix`` option.
474+
475+
If you want to leave new translations empty, use the ``--no-fill`` option.
476+
When enabled, only messages are created, and the translation strings are left
477+
empty. This is particularly useful when using external translation tools, as
478+
it ensures untranslated strings are easily identifiable without any pre-filled
479+
content. Note that when ``--no-fill`` is used, the ``--prefix`` option has
480+
no effect.
481+
482+
.. code-block:: terminal
483+
484+
# changes default prefix
485+
$ php bin/console translation:extract --force --prefix="NEW_" fr
486+
487+
# leaves new translations empty
488+
$ php bin/console translation:extract --force --no-fill fr
489+
490+
.. versionadded:: 7.2
491+
492+
The ``--no-fill`` option was introduced in Symfony 7.2.
493+
470494
.. _translation-resource-locations:
471495

496+
472497
Translation Resource/File Names and Locations
473498
---------------------------------------------
474499

0 commit comments

Comments
 (0)