Sanity Connector

Setting up your Sanity Connector

Only one project in Sanity.io can be connected to Smartling. If you have multiple Sanity.io projects with documents for translation, you will need to create the same amount of Smartling projects and connect each individually.

This article will walk you through:

Connecting Sanity to Smartling

  1. Create a Sanity Connector project type in your Smartling Account
  2. From within this project, click on the gear icon > Project Settings > Sanity Settings
  3. Click Connect to Sanity
  4. Enter the API Token for  (found in Sanity.io)
    • This is the Sanity Project you want to connect to Smartling.
  5. Click Connect
  6. Choose the Sanity Project name from the dropdown (found in Sanity.io). 
    • The Sanity Project contains datasets and the language configuration schema.
  7. Choose the Sanity dataset from the dropdown (found in Sanity.io).
    • This will typically be your production dataset.
  8. Click Save

Your Sanity instance will now be connected to your Smartling project.

Sanity Connector Configuration

General

You can configure your Sanity Studio URL and the behavior of the connector when updates are made to your previously translated content.

  1. From within your Smartling Sanity Project, click on Project Settings > Sanity Settings
  2. Enter the Sanity Studio URL.
    • Smartling will use this URL as a route to link to any asset in your Sanity Studio via the App Link column in the Sanity Asset List.
  3. Click the Automation of Prior Request for Translation dropdown to select your desired behavior.
  4. Click Save

Automation of Prior Request for Translation

  • Auto: The Sanity Connector will detect changes to source content every 3 hours. Any changes detected to the source content will be submitted to Smartling for translation, batched into a Job and sit in awaiting authorization. However, if auto-authorize is enabled under Smartling Settings, the updated content will be batched into a Job and automatically authorized for translation. Smartling will not detect net new content, only updates to content that have been submitted for translation in the past.
  • Manual: The Sanity Connector will detect changes to source content every 3 hours, but will not submit new content for translation. Changed content will be indicated by a checkmark in the Outdated column in the Sanity Progress.
  • Disabled: The Sanity Connector will not detect changes to source content or automatically submit new changes.

3 hours is the recommended shortest time duration between checks. Talk to your Solutions Architect about changing the frequency to longer wave periods using cron.

Language Configuration 

  1. From within your Smartling Sanity Project, click on Project Settings > Sanity Settings
  2. In the Language Configuration section, you will see the number of target languages in your Smartling project, along with the source language in your Smartling project. These details should match dropdown menus with your Sanity target languages.
  3. Choose the correct target language from the dropdown menu to map the language in your Sanity language configuration to your Smartling project target language
  4. Click Save after mapping each of the target languages.

You cannot map a Smartling language to more than one Sanity language. 

Configure Content Parsing

When Smartling captures content from Sanity it may process the fields of an entry based on your configuration settings and may break down the individual fields into even smaller strings for translation. This process makes it easier to produce higher quality translations faster.

Parsing Option

Description

Do not translate

Use this if the field shouldn't be translated using Smartling.

Markdown Parses Markdown tags similar to HTML tags for the best experience by translators and maximum Translation Memory leverage. Use this when your field is likely to have Markdown.
Plain text All text and characters treated as plain text. Use this for fields that you expect to only have plain text with no markup or formatting.
HTML Parses the field's HTML tags for the best experience by translators and maximum Translation Memory leverage.  Use this when your field is likely to have HTML markup in it

 

  1. From your Sanity project, click the gear icon and select Project Settings. Then, on the left side, click Sanity Settings.  
  2. Under Content Parsing, Entries is the default content selection. Click each fields to expand and choose your preferred parsing option.
  3. Click Save.

Smartling Settings

Talk to your Customer Success Manager or Solutions Architect about options on auto-authorization and translation retrieval.

If you choose to integrate a JS library or other visual context tools, consult your Customer Success Manager or Solutions Architect to ensure the default context functionality is disabled. It is enabled by default for the standard visual context.

 

Was this article helpful?