Translate Data using Smartling

The End-to-End Translation use case shows how you can use Contentstack Automation Hub to set up an automated language translation system for your Contentstack-powered website.

In this use case, you will walk through the steps required to perform end-to-end translation of an entry created/updated in contentstack. Also, you will integrate a communication medium (say slack) to notify us whenever an entry gets successfully translated.
The entire translation process consists of eight major steps right from configuring the entry trigger to setting up the slack channel.

Here is the list of processes we need to execute.

  1. Configure Entry Trigger
  2. Add Content to Project
  3. Pause an Automation
  4. Download Translated Content
  5. Add the Transform Function
  6. Localize an Entry
  7. Set Entry Workflow
  8. Send Message

Let’s have a look at the steps in detail. 

  1. Configure Entry Trigger

    1. Log in to your Contentstack account and click the “Automations Hub” icon.
    2. Click + New Project to add a new project.
    3. Click + New Automation.
    4. Enter the Automation Name and Description.
    5. Click Create.
    6. In Configure Trigger, select the Contentstack Trigger connector
      Select-Contentstack-Trigger.png
    7. Click the Entry Trigger option.
      Select-Entry-Trigger.png
    8. Click + Add New Account.
      3.Entry_Trigger_Add_Account.png
    9. Select the Event and the Stack for which you want to configure the trigger. Once done, click Proceed.
      Click-Proceed-Trigger.png
    10. Click Test Trigger.
      Test-Action-Trigger.png
    11. Click Save and Exit.
  2. Add Content to Project

    After you configure the entry trigger, the next step is to configure the Smartling action connector by adding a project and the content you want to translate.

    1. In Configure Action, select the Smartling action connector.
      Smartling-Connector.png
    2. Click Add Content to A Project action.
      Add-Content-To-projects-Select-Action.png
    3. Click + Add New Account to add your Smartling account.
      Add-Account-Smartling-Add-Content.png
    4. Enter the Project ID, the Locale in which you want the content to be translated, and add the Content.
      Select-Projectid-Locale-Content.png
    5. Add the Callback URL and click Proceed.
    6. Note: Smartling uses the Callback URL to resume the automations once the content is translated.

      Click-Proceed-Samrtling.png
    7. Click Test Action.
      Test-Action-Smartling.png
    8. You will get the following response once the action is successfully executed.
    9. Note: From the given set of response, preserve the fileuri as it will be used in the next steps.


      Save-And-Exit-Smartling.png
    10. If all looks good, click Save and Exit to finish the process.

    This sets the Smartling action connector and Add content to the project step.

  3. Pause an Automation

    The third step requires you to configure the Pause connector. The Pause connector lets you pause the automation until Smartling executes the translation process. 

    1. In Configure Action, select the Pause action connector.
      Select-Pause-Connector.png
    2. Select Pause an Automation action.
      Select-Pause-Action.png
    3. Specify the properties you preserved in the previous steps such as file_uri,content_type, andentry_id in the given fields. Then, click Proceed.
    4. Click Test Action.
      Test-Pause-Action.png
    5. You will get the following response once the action is successfully executed.
      Save-Exit-Paus.png
    6. If all looks good, click Save and Exit to finish the process.

    This sets the Pause action connector.

  4. Download Translated Content

    Once the content is successfully translated, the next step is to download the translated content.

    1. In Configure Action, select the Smartling action connector.
      Smartling-Connector.png
    2. Click Download Translated Content action.
      Download-Translated-Content-Samrtling.png
    3. Click + Add New Account to add an account.
      Add-New-Account-Download-Content.png
    4. Enter the Project Id, the Locale, and the File URI you preserved in the previous steps. Once done, click Proceed.
      Click-Proceed-Download-Content.png
    5. Click Test Action.
      Test-Action-Download-Content-Samrtling.png
    6. You will get the following response once the action is successfully executed.
      The translated content is appended in the data1 response shown here.
      Save-Exit-Download-Content.png
    7. Click Save and Exit to finish the process.

    This sets the download translated content action for your Smartling connector.

  5. Add the Transform Function

    In the fifth step, you will add the data1 response preserved in the previous step in a Transform function. This step is required because the Contentstack API expects the translated data in a particular format.

    1. In Configure Action, select the Transform action connector.
      Select-Transform-Action-Connector.png
    2. Click the Transform action.
      Select-Action.png
    3. Enter the Input Name and Input Value for the function in the given fields. Once done, click Proceed.
      Proceed.png
    4. Click Test Action.
      Test-Action.png

    5. You will get the following response once the action is successfully executed.
      Save-Exit.png
    6. Click Save and Exit to finish the process.

    This sets the Transform function.

  6. Localize an Entry

    1. In Configure Action, select the Contentstack action connector.
      Select-Contentstack-Action.png
    2. Click the Localize Entry action.
      Select-Localize-Entry-Action.png

    3. Click + Add New Account to add an account.
      Add-Contentstack-Account.png
    4. Enter details such as Stack, Content Type, Entry, and Locale. Also, add the Entry Data preserved from the Transform function step (step 5). Once done, click Proceed.
      Click-To-Proceed-Contentstack-Action.png
    5. Click Test Action.
      Test-Action-Contenstack-Trigger.png
    6. You will get the following response once the action is successfully executed.
      Save-Exit-Localization-entry.png
    7. Click Save and Exit to finish the process.

    This sets the Localizing an Entry step.

  7. Set Entry Workflow

    The seventh step requires you to add workflow stages for your stack. This will allow you to define different stages of the review process for your team.

    1. In Configure Action, select the Contentstack action connector.
      Select-Contentstack-Action.png

    2. Click the Set Entry Workflow action.
      Select-An-Action.png
    3. Click + Add New Account to add your Contenstack account.
      Add-an-Account.png
    4. Add details such as Stack, Content Type, Entry, Workflow Stage, and Set the Due Date. Also, set “No” for Notify via Email field and add comments if you want to. Once done, click Proceed.
      Select-Details.png
    5. Click Test Action.
      Test-Action.png
    6. Click Save and Exit to finish the process.

    This sets the Set Entry Workflow step.

  8. Send Message

    The last step is to set up a notification channel in Slack.

    1. Click Configure Action and select the Slack action connector.
      Select-Slack-Connector.png
    2. Click the Send Message action.
      Send-Message-Action.png
    3. Click + Add New Account to add your Slack account.
      Add-Slack-Account.png
    4. Add the Slack Channel where you want to get the notifications.
      Select-Slack-Channel.png
    5. Enter the Message body and click Proceed.
    6. Click Test Action.
      Test-Action-Slack.png
    7. Click Save and Exit to finish the process.

    This sets the last step to set up a notification channel in Slack.

Was this article helpful?

Thanks for your feedbackSmile-icon

On This Page

^