Migrating from older versions of the client

The current version of the client maintains backwards compatibility for the tx push and tx pull commands. So, if you have a CI setup that uses them, you should not have to change anything. However, some things need to be different in the configuration files:

The section headers in .tx/config need to be different to also store the organization slug. So after the migration <project>.<resource> should become o:<org>:p:<proj>:r:<res>. In case something fails during this process, we will provide a message with the failed migrated resource so that you can identify and change the section header manually.

If you are using a ~/.transifexrc file for authentication, instead of global flags or environment variables, some new fields must be added there too. You will be prompt for an API token in case you are using a username/password pair in your configuration file. If you are migrating an existing software project from an older version of the Transifex client, you need to run:

→ tx migrate

This will take care of all the changes and create a back up file of the original config in the same folder as config_yyyymmddhhss.bak before we start the migration process.

Differences With the Previous Version

The two clients have some distinct differences when looking under the hood. The new client is using Go instead of Python

  • for speed and
  • for the ability to produce binary files for multiple platforms.

Additionally, client is using APIv3 instead of APIv2 because

  • it is faster (calls occur asynchronously and you don't have to wait for parsing to finish) and
  • APIv2 is getting deprecated.

INIT

The new client's init command creates the .tx folder in the current path, and the config file with the following content which is required for the configuration:

[main]

host=https://www.transifex.com

In case there is already a .tx/config file in the current directory, the users will get a prompt that informs them that, if they proceed, the contents of their .tx/config file will be overridden. An y/n answer is needed to proceed or abort.

ADD

For the previous client, parts of functionality in tx config command adds resources locally.

In the new client, this command is responsible to add a resource in the local config file. Note that it needs all organization, project and resource slugs in order to build the resource id for the APIv3.

It will create a new section in the .tx/config file for a resource like:

[o:org_slug:p:project_slug:r:resource_slug]
...

PUSH

The differences of the new client, are summarized here:

  • resource IDs, can be accepted without the -r flag
  • when neither -s/-t are set, -s is assumed
  • --all flag creates new languages on Transifex if local files exist for them (on previous client this was the default behavior, now it needs the --all flag)
  • without --all or --languages, the only languages that are considered are the intersection of local and remote languages

PULL

  • resource IDs, can be accepted without the -r flag
  • when neither -s/-t are set, -t is assumed
  • without --all or --languages, the only languages that are considered are the intersection of local and remote languages
  • --json download files (translations) as json files
  • --content_encoding/-e The encoding of the file. This can be one of the following:
    • text (default)
    • base64