Initiating a Project
The Transifex Client handles initialization like most VCS systems. The init command creates a new project in your current directory. This then allows you to manage all translation files that are under the project's root directory.
You can run this command from anywhere in your file system. We usually recommend running it in the project's root directory. When run, it creates a small file which stores the association between your local files and Transifex resources.
If you have a project which uses version control and would like to commit this config file, run the init command from the root directory of your repo. This will make the files available to anyone who clones the repository.
You might be managing multiple projects and would like a single configuration file. This is common with translators who use the client to manage their contributions across projects. In this case, you may run this command from a top-level directory.
To initialize a project, use the
tx init command. This is very similar to the way most version control systems handle initialization. This command will create a Transifex project in the current directory.
Here's a sample run:
$ tx init Creating .tx folder... Transifex instance [https://www.transifex.com]:
Press Enter (changing the host name is not recommended)
Creating skeleton... Creating config file... Done.
It's safer to use encrypted HTTP (HTTPS) instead of plain HTTP in order to avoid having your user credentials crossing the wire out in the open. If you are using the client with the Transifex.com servers, the client will ask for your permission to switch all URLs to HTTPS.
If you signed up for Transifex with social signup (e.g. GitHub, Google, LinkedIn), you'll need to set a password for your account before you can configure the client. You can do this by visiting the Transifex signin page and clicking the "Forgot password" link to reset your password.
If you want to automate project initialization, the init command offers some options to set the default host, username, and password so you can use it with non-interactive scripts.
Specify a default Transifex host:
$ tx init --host=www.transifex.com
Specify default username and password for Transifex server:
$ tx init --user=<username> --pass=<password>
Transifex also supports API tokens. To use an API token, use the
tx init --token=<the token provided by Transifex>
Alternatively, you can use
api as the username and the token as the password:
$ tx init --user=api --pass=<the token provided by Transifex>