Table of Contents


The Transifex Live JavaScript snippet is needed to publish translations and make them visible to your site’s visitors. You don’t need to install the snippet to start approving or translating strings if you plan to use the in-app (iFrame) version of Transifex Live.

However, we recommend installing the snippet before doing anything else to take advantage of the Transifex Live sidebar, which runs directly on your site.

Adding a website

Before you can get the JavaScript snippet to add to your site, you’ll need to have a website/Live resource in your web project. The resource will hold your source content and translations. Here’s how to add one if you don’t have one yet:

  1. Create a web project if you don’t have one yet.

  2. Select your project from the project navigation in the Dashboard.

  3. Click the Add website button in the right panel.

  4. Type your website’s URL into the URL field and click Create resource.


Getting the snippet

Note

Each site you translate with Transifex Live (i.e. each resource) has a unique snippet associated with that site’s URL.

Now that you have a web project and resource, you can get the snippet:

  1. Navigate to the Dashboard and select the project with the resource you want to get the snippet for.

  2. Click on Resources.

  3. From the list of resources, click on the one you want to get the snippet for.

    tx-resource-list.png#asset:971

  4. In the header, click Settings.

  5. Copy the snippet from the popup.

    tx-live-snippet.png#asset:972


Installing the snippet

After you have copied the snippet, paste it before the </head> tag of each page you want to translate. And that’s it. You’ll now be able to trigger the Transifex Live sidebar on your site and approve strings for translation.

If the snippet cannot be placed in the </head> tag, then you should set the manual_init parameter to a boolean true value (more info here) and call Transifex.live.init() when you´re ready for the snippet to run.

Note

Some CMS's or publishing platforms might not let you edit the HTML directly. In such situations, look for a field where you can paste JavaScript (e.g. a Google Analytics snippet) and add the Live snippet there.

Using Transifex Live on a staging server

Staging servers are often used to test or preview things before going live. If you have a staging server, you can use the same JavaScript snippet for your production (live) and staging sites.

This lets you approve and translate content from the staging server before taking them live on your production server – without needing to do any duplicate work.

Simply return to the Settings popup you copied the snippet from, enter your staging domain, and hit Save Settings.

tx-staging-domain.png#asset:973

back to top


Continue Reading

Introduction

Working with Projects

Resources and Content

TX Editors and Translations

Transifex Native

Transifex Live

Languages and Locals

Did this answer your question?