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
Select the project that you need to provide the context for.
Go to the Project Settings.
Click on Context for files.
Click on Add Domain to connect one or more domains with the resource files in your project.
Enter the number of domains you would like to set the context for. Here you can also connect your staging environment(s).
Click on Create snippet.
After the snippet is generated, copy it and send it to your developer(s) so they can install it on your website.
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.
Select the project that you need to provide the context for
Go to the Project Settings.
Click on Context for files.
Click on the pencil icon on the right.
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:
Select the project that you need to provide the context for.
Go to the Project Settings.
Click on Context for files.
Click on the trashcan icon on the right.
Click Delete.
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.
When clicking on the "Preview string in website" icon, a user will see a list of URLs where this particular string is found.
Clicking on a URL will open a new tab with the website where the string is highlighted.
💡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.