Transifex

  • Documentation
  • Zapier
  • Zapier - Google Drive

Zapier - Google Drive

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 Google Drive and Transifex Zaps. 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.

Sending new files from Google Drive to Transifex

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.

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.

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.

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 dropdowns as seen below:

    Screenshot-2021-04-26-at-3.33.37-PM.png#asset:8639

    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.