Table of Content

GitHub is central to many development teams’ workflows. In this guide, you’ll learn how to synchronize changes between files hosted on GitHub and your localization projects in Transifex. We will show you how to do this with the Transifex Client and also how to use the Client in conjunction with a Continuous Integration tool for a more automated workflow.


Although this article refers to GitHub, a similar workflow can also be used for GitLab.

Syncing a local project to Transifex with the Transifex Client

Let’s say you made changes in your code and there are new strings that need to be translated. You can use the Transifex Client to push these source changes to Transifex.


Whenever you make changes to strings in your codebase, be sure to update your localization files before committing changes. It’s a good practice to enforce a push policy to ensure everyone knows exactly when to sync their changes to Transifex.

Here are the steps to sync a local project to Transifex using the Client:

  1. Use git pull to ensure your local repository is up to date with the remote GitHub repository.

  2. Install the Transifex Client if it’s not already installed. You can find detailed instructions on how to do this here. The Transifex Client is based on the Git client and uses a similar command structure.

  3. Create a project in Transifex if you don’t have one yet. This project will be used for localizing the resources in your GitHub repository.

  4. From your GitHub repository root, run the tx init command to initialize your local project configuration.

    $ tx init
    Creating .tx folder…
    Transifex instance []:
    Creating skeleton…
    Creating config file…

    You should now have a .tx folder inside of your repository. Inside this folder, a configuration file will contain the information used to identify the project on a Transifex server.

  5. Update the .tx/config file with the configuration for the files you want to localize in Transifex. For example, suppose your localization resources are stored in a directory called locales. In that case, your source translations are stored in a file called en.json, and the slug of the Transifex project you created is i18n, you can issue the following command to create the configuration for this resource:

    tx set --auto-local -r i18n.enjson 'locales/<lang>.json' --source-lang en --type KEYVALUEJSON --source-file locales/en.json --execute

    Now, your .tx/config should look like this:


    host =

    file_filter = locales/<lang>.json
    source_file = locales/en.json
    source_lang = en

    Repeat the same steps for all the files you want to include in your localization process, then add the .tx folder to your Git repository using git add. When other developers pull your changes, they can use the same configuration file to connect their Transifex clients to the Transifex project.


For more details about the different ways to set up a project with the Transifex Client, refer to this article.

When you’re ready to push your updated files to Transifex, use the tx push command. The -s flag pushes source files, while the -t flag pushes translation files:

$ tx push -st
Pushing translations for resource i18n.enjson:
Pushing source file (locales/en.json)
Pushing 'de' translations (file: locales/de.json)
Pushing 'es' translations (file: locales/es.json)

To pull changes into your local project folder, use tx pull:

$ tx pull -a
New translations found for the following languages: de, es
Pulling new translations for resource i18n.enjson (source: locales/en.json)
-> de: locales/de.json
-> es: locales/es.json

From here, simply stage, commit, then push the updated localization files to your GitHub repository.

Integrating the Client with Travis CI

You can automate the above process and create a continuous localization workflow by incorporating the Transifex Client into your continuous integration chain. Here's how to do it:

  1. Follow the steps in the section above to set up your .tx/config file and commit it to your git branch.

  2. Visit the Travis CI website and create an account if you don't have one yet.

  3. Head to and enable travis-ci for your repository.

  4. On your enabled repository, hit More options > Settings at the top right.

  5. In the Environment Variables section, add two new secret env vars. You can use TRANSIFEX_USER/username with TRANSIFEX_PASSWORD/password, or TRANSIFEX_USER/api with TRANSIFEX_PASSWORD/api key.


  6. Inside your repository, add a .travis.yml file if you don't already have one. We will install Transifex Client and push if the tests pass successfully. Once you have a .travis.yml file, add a section like this inside of it:

    sudo: required
    - pip install virtualenv
    - virtualenv ~/env
    - source ~/env/bin/activate
    - pip install transifex-client
    - sudo echo $'[]\nhostname =\nusername = '"$TRANSIFEX_USER"$'\npassword = '"$TRANSIFEX_PASSWORD"$'\ntoken = '"$TRANSIFEX_API_TOKEN"$'\n' > ~/.transifexrc
    - tx push -s

  7. Commit the travis.yml file to the branch you want to sync translations from. Now every time you commit changes in this branch, your content will be uploaded to Transifex, and your resources will be updated automatically.

back to top

Continue Reading

Content Management



Help Center



Did this answer your question?