php bin/console translation:update

Update the translation file

Usage

translation:update [--prefix [PREFIX]] [--output-format [OUTPUT-FORMAT]] [--dump-messages] [--force] [--clean] [--domain [DOMAIN]] [--xliff-version [XLIFF-VERSION]] [--sort [SORT]] [--as-tree [AS-TREE]] [--] <locale> [<bundle>]

Arguments

locale   The locale 
bundle   The bundle name or directory where to load the messages 

Options

      --prefix          Override the default prefix 
      --output-format   Override the default output format 
      --dump-messages   Should the messages be dumped in the console 
      --force           Should the update be done 
      --clean           Should clean not found messages 
      --domain          Specify the domain to update 
      --xliff-version   Override the default xliff version 
      --sort            Return list of messages sorted alphabetically 
      --as-tree         Dump the messages as a tree-like structure: The given value defines the level where to switch to inline YAML 

Help

The translation:update command extracts translation strings from templates
of a given bundle or the default translations directory. It can display them or merge
the new ones into the translation files.

When new translation strings are found it can automatically add a prefix to the translation
message.

Example running against a Bundle (AcmeBundle)

  php bin/console translation:update --dump-messages en AcmeBundle
  php bin/console translation:update --force --prefix="new_" fr AcmeBundle

Example running against default messages directory

  php bin/console translation:update --dump-messages en
  php bin/console translation:update --force --prefix="new_" fr

You can sort the output with the --sort flag:

    php bin/console translation:update --dump-messages --sort=asc en AcmeBundle
    php bin/console translation:update --dump-messages --sort=desc fr

You can dump a tree-like structure using the yaml format with --as-tree flag:

    php bin/console translation:update --force --output-format=yaml --as-tree=3 en AcmeBundle
    php bin/console translation:update --force --output-format=yaml --sort=asc --as-tree=3 fr