• Documentation
  • CLI Client
  • Push: Upload Resources

Push: Upload Resources

You can push your files to Transifex using the tx push command.

Pushing resource files to Transifex

The first time you push a source file to Transifex you should use the -s|--source flag with the push command. And if you want to push translation files as well, you should use the -t|--translations flag in addition to the -s flag. 

By using the -s flag, Transifex will create a corresponding resource for each pushed source file if one doesn't already 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

Resources that don't already exist in Transifex

If the resource you're pushing doesn't exist in Transifex yet, 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.

How source string updates are handled

When pushing source files, Transifex will update the source strings of a resource to match those from the new source file. This may result in the 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 Transifex handles differences between the old and new source files:

  • New strings are added.
  • Modified strings are considered new ones and added as well.
  • Strings that aren't in the new source file – including ones which have been modified – are removed from Transifex. However, your old translations are kept in the Translation Memory of your project.

More information on how source strings are handled can be found here.

Additional command options

There are additional options available for the tx push command:

  • -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.
  • --no-interactive: Don't require user input when forcing a push.
  • -h: Show the help screen for the command.
  • -x, --xliff: Upload XLIFF versions of your translation files. The XLIFF files are expected to be found alongside the original translation files, with the same name followed by a .xlf extension. Let's say your file is under translations/<lang>/trans.po. If you add the --xliff argument to the push command, the client will search for translations/<lang>/trans.po.xlf. If it finds the file, it will upload it to Transifex. Note that this only works if you're on the Enterprise plan.

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