Contentstack Demonstrates 295% ROI as Part of New Go Composable Initiative295% ROI with ContentstackRead more
cs-icon.svg

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 a 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. Click Configure Trigger from the left navigation panel.
    7. Within the Configure Trigger step, click the Contentstack connector.
    8. Select Entry Trigger.
    9. Click + Add New Account to add your Contentstack account.

    10. Select the Event and the Stack for which you want to configure the trigger.
       
    11. Click Proceed.
    12. Click Test Trigger.
    13. Click Save and Exit.
  2. Add Content to a 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. Click Configure Action Step from the left navigation panel.
    2. Click Action Step to configure third-party services.
    3. Within the Configure Action Step, click the Smartling connector.
    4. Click Add Content to a Project action.
    5. Click + Add New Account to add your Smartling account.


    6. Select the Project ID, the Locale in which you want the content to be translated, and add the Contents.
    7. Add the Callback URL and click Proceed.

      Note: Smartling uses the Callback URL to resume the automations once the content is translated.

    8. Click Test Action.
    9. You will get the following response once the action is successfully executed.

      Note: From the given set of response, preserve the fileuri as it will be used in the next steps.

    10. If all looks good, click Save and Exit to finish the process.

    This sets the Smartling action connector and Add Content to a 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. Click + Add Step under the Else step from the left navigation panel.
    2. Within the Configure Action Step, click the Pause connector.
    3. Under Choose an Action, select the Pause an Automation action.
      Select-pause-Action.png
    4. Specify the properties you preserved in the previous steps such as file_uri,content_type, andentry_id in the given fields. Then, click Proceed.

    5. Click Test Action.


    6. You will get the following response once the action is successfully executed.


    7. 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. Click + Add Step under the Else step from the left navigation panel.
    2. Within the Configure Action Step, click the Smartling connector.
    3. Under Choose an Action, select the Download Translated Content action.
    4. Click + Add New Account to add an account.
    5. Specify the Project ID, the Locale, and the File URI you preserved in the previous steps. 
    6. Once done, click Proceed.
    7. Click Test Action
    8. You will get the following response once the action is successfully executed.
      The translated content is appended in the data1 response shown here.
    9. 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. Within the Configure Action Step, click the Transform connector.
    2. Under Choose an Action, select the Transform action.
    3. Specify the Input Name and Input Value for the function in the given fields.
    4. Once done, click Proceed.
    5. Click Test Action.


    6. You will get the following response once the action is successfully executed.

    7. Click Save and Exit to finish the process.

    This sets the Transform function.

  6. Localize an Entry

    1. Click + Add Step under the Else step from the left navigation panel.
    2. Within the Configure Action Step, click the Contentstack connector.
    3. Under Choose an Action, select the Localize Entry action.
    4. Click + Add New Account to add your Contentstack account.

    5. Enter details such as Stack, Content Type, Entry, and Locale. Also, add the Entry Data preserved from the Transform function step (step 5). 

    6. Once done, click Proceed.
    7. Click Test Action.


    8. You will get the following response once the action is successfully executed.

    9. 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. Click + Add Step under the Else step from the left navigation panel.
    2. Within the Configure Action Step, click the Contentstack connector.

    3. Under Choose an Action, select the Set Entry Workflow action.
    4. Click + Add New Account to add your Contenstack account.
    5. Add details such as Stack, Content Type, Entry, Workflow Stage. You can add dynamic parameters such as Set Due Date, Notify via Email, Locale and let you add Workflow Comments.
    6. Once done, click Proceed.
    7. Click Test Action.


    8. 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 + Add Step under the Else step from the left navigation panel.
    2. Within the Configure Action Step, click the Slack connector.
    3. Under Choose an Action, select the Send Message action.
    4. Click + Add New Account to add your Slack account.
    5. Add the desired Slack Channel where you want to get the notifications. Enter the Message body.
    6. Click Proceed.
    7. Click Test Action.
    8. 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?
^