Skip to content

Commit ccc4c46

Browse files
committed
Add --prefix and --no-fill to translation page
1 parent aea7997 commit ccc4c46

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

translation.rst

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -467,6 +467,26 @@ 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+
# change default prefix for new translations
485+
$ php bin/console translation:extract --force --prefix="NEW_" fr
486+
487+
# leave new translation empty
488+
$ php bin/console translation:extract --force --no-fill fr
489+
470490
.. _translation-resource-locations:
471491

472492
Translation Resource/File Names and Locations

0 commit comments

Comments
 (0)