Pushing new translations

You can push your files to the Transifex server using the tx push command. The first time you push a WordPress project to Transifex you should use the -s|–source flag with the push command, in order to push the source file. If you want to push the translation files as well, you should use the -t|–translations in addition to the -s flag. By using the -s flag, the Transifex server will create a corresponding resource to each pushed source file, if one does not exist on the server. On consecutive pushes, you may omit this flag and only include it whenever you want to update the source strings of your resource:

$ tx push -s -t

In case the resource does not already exist in Transifex, you should set the option type in your .tx/config file to denote the type of resource you have. This option can go either in the main section of the file (so that it applies to all resources) or in the section of the resource.

When pushing source files, Transifex will update the source strings of a resource to match those from the new source file. This operation may result in loss of information, so please pay extra attention when pushing a source file. This is the reason why –source isn’t enabled by default.

Here’s how differences between the old and new source files will be handled:

  • New strings will be added.
  • Modified strings will be considered new ones and added as well.
  • Strings which do not exist in the new source file (including ones which have been modified) will be removed from the database, along with their translations.

Keep in mind, however, that old translations are kept in the Translation Memory of your project.

Additional options for the tx push command are:

  • -l  Specify which translations you want to push (defaults to all)
  • -r Specify the resource for which you want to push the translations (defaults to all)
  • -f Push source files without checking modification times
  • –skip Don’t stop on errors. Useful when pushing many files concurrently.
  • -s Push the source file to the server
  • -t Push the translation files to the server
  • –no-interactive Don’t require user input when forcing a push
  • -h Shows the help screen for the command

By default, Transifex will try to guess when the pushed files are not changed and it will skip them. To force the push operation, you should use the –force option.

Pull the translations

Leave a Reply

Your email address will not be published. Required fields are marked *