Skip to main content
Context for Files

Learn how to provide visual context to translators, allowing them to see how the strings look on your website with Context for Files.

Jacob Doulkeridis avatar
Written by Jacob Doulkeridis
Updated over 9 months ago

With context for files, you can link your project with one or more web domains. A couple of clicks later, strings will appear highlighted within your web product. Getting visual context has never been easier.

For translators and reviewers to be able to view the context for your project’s resource files, first, you need to create a .js snippet.

📝Note: Context for Files feature is available on the Enterprise Plus plan.


Create the JS snippet for one or more of your domains

  1. Select the project that you need to provide the context for.

  2. Go to the Project Settings.

  3. Click on Context for files.

  4. Click on Add Domain to connect one or more domains with the resource files in your project.

    add_domain2.png#asset:6092

  5. Enter the number of domains you would like to set the context for. Here you can also connect your staging environment(s).

    add_domain_field.png#asset:6093

    Click on Create snippet.

  6. After the snippet is generated, copy it and send it to your developer(s) so they can install it on your website.

    copy_snippet.png#asset:6094

Once the snippet is installed, strings will be fetched from your website and mapped against the strings from your file-based project.

📝 Note: The web pages of your domains must be visited by you or your users at least once. This way, the snippet can identify your content.


Installing the snippet

After you have copied the snippet, paste it before the end of the </body> of every page of your website. It can be installed on any domain and any staging environment.

Once the snippet is installed and strings are mapped to your website, your translators and reviewers will be able to see the context for the strings they are working on.


Editing the snippet

After creating the snippet, you can edit it and add/remove one or more domains associated with your file-based project.

  1. Select the project that you need to provide the context for

  2. Go to the Project Settings.

  3. Click on Context for files.

  4. Click on the pencil icon on the right.

    pencil_icon.png#asset:6095

    Select to remove or add one or more domains.


Deleting the snippet

By deleting the snippet, you delete all associations between the domain(s) and your file-based project. So your project will no longer receive strings from your web app.

To delete the snippet:

  1. Select the project that you need to provide the context for.

  2. Go to the Project Settings.

  3. Click on Context for files.

  4. Click on the trashcan icon on the right.

    delete_icon.png#asset:6096

  5. Click Delete.

    delete_snippet.png#asset:6097


Previewing strings in-context

The presence of context is indicated by the eye icon above a string's translation box. Once a translator selects a string to translate, they will see the eye icon if any context is available.

eye_icon.png#asset:6098

When clicking on the "Preview string in website" icon, a user will see a list of URLs where this particular string is found.

list_of_URLs.png#asset:6099

Clicking on a URL will open a new tab with the website where the string is highlighted.

website_view.png#asset:6100


💡Tip

Looking for more help? Get support from our Transifex Community Forum!

Find answers or post to get help from Transifex Support and our Community.

Did this answer your question?