Transifex

  • Documentation
  • Transifex Integrations
  • Zapier

Zapier

Note

The Zapier integration is currently available in private beta. If you're interested in trying it out, please contact us. Additionally, please note that Zapier is a freemium service.

Zapier is a tool that lets you connect different apps together and set up “Zaps” to automate tasks. These Zaps, or workflows, are created by connecting triggers (events) in one app with actions (tasks performed) in another. The Transifex app in Zapier supports the following triggers and actions:

  • Triggers: Translation completed, Review completed, Fillup completed, Any of the above (These are the same events supported by our webhooks)
  • Actions: Upload file to Transifex, Download file from Transifex

With these, you can set up workflows (Zaps) like these:

  • Get notified in Slack each time translations for a language are complete
  • Push new source files from Dropbox to Transifex
  • Download translated files to Dropbox when translations are complete

Below, we’ll guide you through the process of setting up the three Zaps above. However, the beauty of Zapier is that it’s flexible. You can use the supported triggers and actions to create similar Zaps connected to other services (e.g. HipChat or Box) or create something totally new.

Get Slack notifications about finished translations

For this Zap, we’ll first set up a trigger based on an event in Transifex (translations are completed). Then we’ll set up an action to take place in Slack (message a channel) whenever that event occurs. You can follow these steps to get notified about other events, or send notifications through another service.

Setting up the Transifex trigger

  • Sign up for a Zapier account if you don't already have one, then log into the Zapier Dashboard and click the Make a Zap! button in the header.

  • You’ll be asked to choose a trigger app. Search for Transifex and select it from the drop down.

    zapier-choose-trigger-app.png#asset:3840

  • Select the event you want to use as a trigger. For this example, we’ll choose Translations completed. Once you've selected a trigger, hit Save + Continue.

  • Click on Connect a New Account to link Zapier to Transifex. In the popup window, put in a Transifex webhook secret. Remember the secret because you’ll need it later. You can also add in your API key if you plan on setting up a Zap for downloading files later. Hit Save + Continue.

  • Copy the target webhook URL. Then head to Transifex (preferably in a new tab), and go to the Settings for the project you want to set up this Zap for. In the submenu, click on Webhooks and then Add webhook.

  • Paste the URL you copied earlier into the URL field. Enter in the secret from earlier, and choose which event this webhook is for. The event you select should be the same as the trigger you selected in Step 2 above. Set the Webhook to Active, then click Save Changes

    zapier-webhook-setup.png#asset:3841

  • Once you’ve set up the webhook in Transifex, head back to Zapier and click Continue.

  • Click Fetch & Continue to make sure the webhook is working. Then hit Continue.

Setting up the Slack action and activating your Zap

Once you've set up the trigger, you can set up the action.

  • Choose an action app. In this case, we’ll search for and select Slack.

  • From the available actions, choose Send Channel Message and hit Save + Continue.

    zapier-choose-action.png#asset:3842

  • Click on Connect a New Account and authorize Slack. Once you’ve done this, hit Save + Continue.

  • Set up and customize the message you want to see in Slack by selecting the Channel the message should appear in, as well as putting in a message text. You can customize the message to say whatever you want, and include variables such as the project name by clicking on the Insert a Field icon on the right side of the text box.

    zapier-slack-message.png#asset:3843

    You can customize other options, such as the Bot name. When you're finished with the customizations, click Continue.

  • Click Create & Test to test the connection. If the test is successful, click Finish.

  • Give your Zap a name, then switch it on!

Sending files from Dropbox to Transifex

For this Zap, we’ll first set up a trigger based on an event in Dropbox (a new file being added). Then we’ll set up an action (uploading the file to Transifex) to take place in Transifex whenever that event occurs. You can follow these steps to send files from other services to Transifex.

Setting up the Dropbox trigger

  • Sign up for a Zapier account if you don't already have one, then log into the Zapier Dashboard and click the Make a Zap! button in the header.

  • You’ll be asked to choose a trigger app. Search for Dropbox and select it from the drop down.

  • Select New File in Directory as the trigger then click Continue.

  • Click on Connect a New Account and authorize Dropbox. Once you’ve done this, hit Save + Continue.

  • Select the Dropbox directory where you'll be adding your source files, then click Continue.

    zapier-dropbox-directory.png#asset:3844

  • Click Fetch & Continue to make sure the webhook is working. If the test is successful, hit Continue.

Setting up the Upload action and activating your Zap

Once you've set up the trigger, you can set up the action.

  • Choose an action app. In this case, we’ll search for and select Transifex.

  • From the available actions, choose Upload files to Transifex, then hit Save + Continue.

  • Click on Connect a New Account to link Zapier to Transifex. In the popup window, put in your API key. You can also put in a Transifex webhook secret if you plan on setting up a Zap for downloading files from Transifex. Remember the secret because you’ll need it later. Hit Save + Continue.

  • On this page, enter the project slug of the project in Transifex you want to upload the source file to. Then set the Name field to File Name and File field to File. For the i18n Type, choose the format of the files you'll be sending from Dropbox to Transifex. Click Continue once you're done with the configuration.

    zapier-file-upload.png#asset:3845

  • Click Create & Continue to make sure everything is working. If the test is successful, hit Finish.

  • Give your Zap a name, then switch it on!

Downloading files from Transifex to Dropbox

For this Zap, we’ll first set up a trigger based on an event in Transifex (translations are completed). Then we’ll set up two actions. One to download the translation files from Transifex, and one to upload those files to Dropbox. You can follow these steps to get notified about other events, or send notifications through another service.

Setting up the Transifex trigger

First, you'll need to set up the trigger. The process for this is the same as the one for the Slack notification slack. Please refer to the instructions there for the step-by-step details.

Setting up the Download action

Before we can upload a file to Dropbox, we need to download it from Transifex first. Here's how to set this up:

  • Choose an action app. In this case, we’ll search for and select Transifex.

  • From the available actions, choose Download file to Transifex, then hit Save + Continue.

  • Connect a New Account to link Zapier to Transifex. In the popup window, put in your API key. You can also put in a Transifex webhook secret if you plan on setting up a Zap for uploading files from Transifex. Remember the secret because you’ll need it later. Hit Save + Continue

  • Using the dropdowns, set the Project field to Project, Resource field to Resource, and Language field to Language. Then click Continue.

    zapier-download-config.png#asset:3846

  • You’ll be brought to the Test screen. You can click Skip test & continue and move on to steps below.

  • Click the + icon in the left panel to add another action step. Search for Dropbox and select it from the drop down. 

  • Select the Upload File action then click Continue.

  • Click on Connect a New Account and authorize Dropbox if you haven’t done so already. Once you’ve done this, hit Save + Continue.

  • On this page, configure the settings as follows using the dropdowns.

    Directory = Use a Custom Value (advanced); Custom Value for Directory Path = Target path where the file will be stored; File = Translated file downloaded from Transifex; Overwrite = Yes; Specify File Name = Filename of the file

    Then hit Continue.

    zapier-dropbox-upload.png#asset:3847

  • Again, click Skip test & continue. Then click Continue again.

  • Give your Zap a name, then switch it on!

Continuous Automation with Google Drive

If you store spreadsheets and documents that you wish to translate on Google Drive then you can use Zapier to automatically upload new and updated files to Transifex while automatically sending completed translations back to Google Drive.

A. Pushing new files from Google Drive to Transifex

Please note that the procedure described here needs to be repeated for each directory in google drive or each project in Transifex. A single zap can be used to push multiple source files within the same Google Drive directory to Transifex.

  • Create a new Zap.

  • On the “when this happens“ section Choose App, select Google Drive.

  • From the events list that appears choose the second option, "New File In Folder" as seen below:

    zapier-up-1.jpg#asset:8042

    Click the "Continue" button to proceed.

  • Enter Your Google Drive Security Credentials.

    choose-account.jpg#asset:8043

    Press the "continue" button to proceed.



  • Choose the path in Google drive that contains the source files you want to upload into Transifex.

    choose-drive.jpg#asset:8044

    Press the "continue" button to proceed.

    Test the "trigger" to ensure that the criteria set is correct.

  • Now we will configure the Transifex side. Choose the latest version of Transifex when prompted to do so as seen below:

    2do-this.jpg#asset:8045

  • Choose the appropriate Transifex event as seen below:

    2-choose-app-event.jpg#asset:8046


    Click the "Continue" button to proceed.


  • Enter your Transifex credentials by selecting the drop down and clicking "Add a New Account":

    2-add-new-account.jpg#asset:8047

    In the page that appears enter your API token. This is obligatory. However the Webhook secret is optional. To generate an API Token follow the instructions here.

    api-token.jpg#asset:8048

    Click "Yes,Continue" and then click on the "Continue" button to proceed.


  • Define the relevant Transifex parameters:

    step-2-new.jpg#asset:8167



    Click on the "Continue" button to proceed, and then test the action to confirm that everything is working. Once everything is working save the Zap and turn it on.

    Where:

    Project is the slug that can be obtained from the project URL as seen below:

    project_URL.jpg#asset:8050



  • Troubleshooting:

    - Be patient. The zap can take up to an hour to trigger when uploading a new file to google drive.

    - If the file still doesn't upload consult the following guide.

    - Wait 5 minutes before turning on the zap.

B. Updating Existing Resources in Transifex With Changes Detected in Google Drive.

Please note that a zap needs to be created for each gdrive directory or each Transifex project. However a single zap can be used to push multiple updated files residing in the same google drive directory. As a prerequisite to this step, please complete step A (Pushing new files from Google Drive to Transifex).

The same functionality can also be accomplished by the AutoUpdate Resource feature. The benefit of using Zapier is that your files do not need to be public, they can be private files that sit behind a secure login.

  • From within your Zapier Home Page, copy the zap created in step A. To do this find your Zap, click the down arrow button and select copy as seen below:

    copy-zap.jpg#asset:8055


  • Once the Zap is copied, click the down arrow button again to rename it. Then click on the zap in order to edit it.

  • Click on the Google Drive entry and modify the event from New File to Updated File as seen below:

    update.jpg#asset:8056

    Click the "Continue" button twice to proceed.


  • Customize the updated file parameters as seen below:

    step-1-new.jpg#asset:8168


    Click the "Continue" button to proceed.



  • Update a file on Google Drive and test to make sure that the update is detected.

    Click the "Continue" button to proceed.

  • Now test to see that the updates get sent to Transifex by clicking the "Retest Action" button as seen below.

    upload3.jpg#asset:8058


  • Turn on the Zap if the test is successful.

  • Troubleshooting:

    - Wait 5 minutes after turning on the zap before making any updates to the files in Google Drive.

    - Any updates after that time period may take up to 1 hour to trigger the zap.

    - Updates will not happen to deleted files. When a file is deleted in Google Drive that file has to be deleted in Transifex either manually, through the CLI Client or through the API.

C. Sending Completed Translations From Transifex to Google Drive.

Please note that a single zap is required for each directory in Google Drive or each project in Transifex. However a single zap will upload translation files form multiple resources and language pairs.

  • Create a new Zap.

  • On the “when this happens“ section Choose App, search for the latest version of Transifex as seen below:

    Choose-A-Trigger.jpg#asset:8169


     .

  • Select from one of the four trigger events:

    Trigger-Event.jpg#asset:8170

  • Select Your Transifex security credentials:

    choose-account-4.jpg#asset:8171


    In the page that appears enter your API token. This is obligatory. However the Webhook secret is optional. To generate an API Token follow the instructions here.

    api-token.jpg#asset:8048

    Click "Yes,Continue" and then click on the "Continue" button to proceed.

  • Setup the webhook that will trigger in Transifex once the event in item 2 is triggered. From the "Set Up Webhook" option copy the Webhook URL that the Zapier App provides as seen below:

    Goto your Transifex project. Click on settings then select the web-hooks tab. Paste the web-hook while ensuring that you are using the same trigger as specified in item 2. More information for adding web-hooks in Transifex can be found here

    Press the "Continue" button to proceed.

  • If you haven't already done so, click on the "Test" Button to test the web-hook. If a message is receive stating that "We found a request!" then proceed to the next step by clicking the "Continue" button.

    webhook.jpg#asset:8172

  • Add a new action. Find the latest version of the Transifex App and select it.

    Add-new-action.jpg#asset:8173




  • Select "Download file from Transifex" as the Action Event.

    downlaod-action.jpg#asset:8174

    Press the "Continue" button to proceed.

  • Choose the account created/used in step 3 above. Press the "Continue" button to proceed.

  • In the "Customize Download" section populate the drop downs as seen below:


    Press the "Continue" button to proceed.

  • As an option, test the configuration to see if a file is downloaded. Keep in mind that this test will not return anything if you don't have any languages in your project that are 100% translated.

    Proceed to the next step.

  • Add a new action for Google Drive. Find the "Google Drive" app and select it.

  • Select the following events:

    step-3-upload-gdrive.jpg#asset:8175

    Press the "Continue" button to proceed.

  • Choose The Appropriate Google Account as seen below:

    GDrive-Account.jpg#asset:8176

    Press the "Continue" button to proceed.

  • Customize the "Upload File" (i.e translation file) as seen below and then press the "Continue" button to proceed:

    cust-file-up.jpg#asset:8177

    Note that the "Filename" is customizable with a mix of text and predefined variables. Always use the predefined variables if you wish to use this zap for all of the resources in a given project. The "Filename of the file:" parameter uses the resource slug of the source file. If you are unhappy with the resource slug then change it in Transifex by following the instructions indicated here (Note: these instructions are for changing a category, but a slug is changed from the same popup).

  • As an option test the zap. Make sure to turn on the zap when finished. At this point there should be 3 steps/actions to your zap.