# Enable Literature Abstract Translation

Learn how to configure your Vault to send literature abstracts for translation.

## About the Feature

With the 23R3 release, SafetyDocs leverages the Amazon Translate Connection to translate non-English literature abstracts into English. When you upload literature articles, Vault automatically detects the language of the abstract and populates it on the _Literature Article_ record. Determine your translation needs, send abstracts for translation, and receive the translated versions all within Vault. For more information, see <a href="/en/lr/01443/">Translate Literature Abstracts</a>.

<div class="note-border alert-info">
  <div class="alert alert-info" role="alert">
    <div><i class="far fa-info-circle"></i></div>
    <div class="alert-text">
      <p><strong>Note</strong>: While this article describes enabling the Amazon Translate connection, you can enable Literature Abstract Translation using a non-AWS translation service for custom integrations. Contact <a class="external-link " href="https://support.veeva.com/hc/en-us" target="_blank" rel="noopener">Veeva Support<i class="fa fa-external-link" aria-hidden="true"></i></a> for more information.</p>
    </div>
  </div>
</div>



### 25R1 Update: Highlight Literature Abstract Terms

With the 25R1 release, the _Abstract_ control section replaces the _Abstract (English)_ section on the _Literature Article_ object. This control section contains a drop-down that enables the user to toggle the _Abstract_ text between English and its original language, eliminating the need for a separate English language field. 

To update your Vault to support this functionality, you must <a href="/en/lr/01318/#update-the-literature-article-object-layout">update the _Literature Article_ object layout</a>.

## Enable the Amazon Translate Connection

To use this feature, your organization must have an Amazon Web Services (AWS) account with Amazon Translate. Once that is set up, complete the following tasks:

<ul>
    <li>Set up an Amazon Simple Storage Service (Amazon S3) bucket</li>
    <li>Set up an Identity and Access Management (IAM) role and configure its event bus</li>
    <li>Communicate your AWS Account ID to Veeva Support</li>
</ul>

### Set Up an Amazon S3 Bucket {#set-up-amazon-s3-bucket}

Complete the following steps to add an Amazon S3 bucket to your AWS account:

1. Create an S3 bucket with a name of your choosing in <a class="external-link " href="https://docs.aws.amazon.com/translate/latest/dg/async.html" target="_blank" rel="noopener">an AWS region that supports batch translation<i class="fa fa-external-link" aria-hidden="true"></i></a>.
2. In the S3 bucket, create two folders with the following names:
  * `translate_folder`
  * `translate_output`

### Set Up an Identity and Access Management (IAM) Role {#set-up-iam-role}

To set up an AWS IAM role, which will be assumed by Safety, you must complete the following tasks:

* <a href="#generate-external-id">Generate an External ID in Safety</a>
* <a href="#configure-iam-role">Configure an IAM role in AWS</a>

#### Generate an External ID in Safety {#generate-external-id}

In Safety, complete the following steps to generate an External ID on the **Amazon Translate Connection** record:

1. Go to **Admin > Connections > Amazon Translate Connection**.
2. In the **All Actions** menu, select **Generate External ID**.

#### Configure an IAM Role in AWS {#configure-iam-role}

In your AWS account, complete the following steps to configure an IAM role for Safety to assume:

<ol>
    <li>Create an IAM role with a name of your choosing.</li>
    <li>Add the following permission set, replacing <code>&lt;Your account id&gt;</code>, <code>&lt;Your Role Name&gt;</code>, and <code>&lt;Your Bucket Name&gt;</code> with the applicable details:<br>
        <code>{<br>
            &nbsp; &nbsp;"Version": "2012-10-17",<br>
            &nbsp; &nbsp;"Statement": [<br>
            &nbsp; &nbsp; &nbsp; {<br>
            &nbsp; &nbsp; &nbsp; &nbsp;"Action": "iam:PassRole",<br>
            &nbsp; &nbsp; &nbsp; &nbsp;"Resource": "arn:aws:iam::&lt;Your account id&gt;:role/&lt;Your Role Name&gt;",<br>
            &nbsp; &nbsp; &nbsp; &nbsp;"Effect": "Allow"<br>
            &nbsp; &nbsp; &nbsp; },<br>
            &nbsp; &nbsp; &nbsp; {<br>
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"Action": [<br>
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"translate:StopTextTranslationJob",<br>
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"translate:ListTextTranslationJobs",<br>
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"translate:StartTextTranslationJob",<br>
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"translate:TranslateText",<br>
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"translate:DescribeTextTranslationJob",<br>
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"translate:TranslateDocument"<br>
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;],<br>
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"Resource": "*",<br>
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"Effect": "Allow"<br>
            &nbsp; &nbsp; &nbsp; &nbsp;},<br>
            &nbsp; &nbsp; &nbsp; &nbsp;{<br>
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"Action": [<br>
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"s3:GetObject",<br>
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"s3:ListBucket",<br>
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"s3:PutObject",<br>
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"s3:GetBucketLocation",<br>
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"s3:DeleteObject",<br>
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"s3:DeleteBucket"<br>
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;],<br>
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"Resource": [<br>
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"arn:aws:s3:::&lt;Your bucket name&gt;",<br>
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"arn:aws:s3:::&lt;Your bucket name&gt;/*"<br>
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;],<br>
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"Effect": "Allow"<br>
            &nbsp; &nbsp; &nbsp; &nbsp;}<br>
            &nbsp; &nbsp; &nbsp;]<br>
            &nbsp; &nbsp;}
        </code>
    </li>
        <li>Add the following trust relationships replacing <code>&lt;Your generated external ID&gt;</code> with the Safety-generated <em>External Id</em>.<br>
        <code>{<br>
            &nbsp; &nbsp;"Version": "2012-10-17",<br>
            &nbsp; &nbsp;"Statement": [<br>
            &nbsp; &nbsp; &nbsp; {<br>
            &nbsp; &nbsp; &nbsp; &nbsp;"Effect": "Allow",<br>
            &nbsp; &nbsp; &nbsp; &nbsp;"Principal": {<br>
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"Service": "translate.amazonaws.com"<br>
            &nbsp; &nbsp; &nbsp; &nbsp; },<br>
            &nbsp; &nbsp; &nbsp; &nbsp; "Action": "sts:AssumeRole"<br>
            &nbsp; &nbsp; &nbsp; &nbsp;},<br>
            &nbsp; &nbsp; &nbsp; &nbsp;{<br>
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"Effect": "Allow",<br>
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"Principal": {<br>
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"AWS": [<br>
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"arn:aws:iam::091592193973:root"<br>
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;]<br>
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;},<br>
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"Action": "sts:AssumeRole",<br>
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"Condition": {<br>
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"StringEquals": {<br>
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"sts:ExternalId": &lt;Your generated external ID&gt;<br>
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br>
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br>
            &nbsp; &nbsp; &nbsp; &nbsp;}<br>
            &nbsp; &nbsp; &nbsp;]<br>
            &nbsp; &nbsp;}
        </code>
    </li>
    <li>On your default event bus, create a rule to push completed translation jobs to Veeva's event bus.</li>
    <li>Configure the rule as described below:
        <ul>
            <li>Add the following event pattern:<br>
                <code>{<br>
                     &nbsp; &nbsp;"source": ["aws.translate"],<br>
                     &nbsp; &nbsp;"detail-type": ["Translate TextTranslationJob State Change"]<br>
                     }
                 </code>
             </li>
             <li>Based on the region of your Vault and the release type (General or Limited), add a target for the form using the following format: <br>
                <code>arn:aws:events:< region >:091592193973:event-bus/< region > <br>
                    - < release >-prod-Vault-Safety-Connections-Event-Bus</code>
                <ul>
                    <li>For example, if your Vault is in us-east-1 and in the General Release environment, your target would be as follows:<br> <code>arn:aws:events:us-east-1:091592193973:event-bus/<br>
                    us-east-1-gr-prod-Vault-Safety-Connections-Event-Bus</code></li>
                </ul>
            </li>
        </ul>
    </li>
</ol>

### Communicate AWS Account ID to Veeva Support

Contact <a class="external-link " href="https://support.veeva.com/hc/en-us" target="_blank" rel="noopener">Veeva Support<i class="fa fa-external-link" aria-hidden="true"></i></a> to provide your AWS Account ID. This enables us to complete the setup of your Translate Connection. You will be contacted when the feature is ready for use.

### Additional Resources

To find out more about configuring AWS accounts to be accessible by third parties, see the following resources:

* <a class="external-link " href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_common-scenarios_third-party.html" target="_blank" rel="noopener">Providing access to AWS accounts owned by third parties<i class="fa fa-external-link" aria-hidden="true"></i></a>
* <a class="external-link " href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-user_externalid.html" target="_blank" rel="noopener">How to use an external ID when granting access to your AWS resources to a third party<i class="fa fa-external-link" aria-hidden="true"></i></a>
* <a class="external-link " href="https://calculator.aws/#/" target="_blank" rel="noopener">AWS Pricing Calculator<i class="fa fa-external-link" aria-hidden="true"></i></a>: This calculator can be used to estimate the cost of the Amazon Translate service based on your Case volume.


## Configure Layouts

Layouts are managed through **Admin > Configuration > Objects > [Object] > Layouts**.

### Literature Article Object Layout

To update the _Literature Article_ object layout:

1. Navigate to **Admin > Configuration > Objects >  Literature Article > Layouts >  Literature Article Detail Page Layout**.
2. Within the _Article Details_ section, select **Add > Abstract Language**.
3. Select **Save**.

### Translation Record Object Layout

In the **Connection** object, go to **Layouts > Translation Record Detail Page Layout** and complete the following configuration:

<ol>
    <li>On the <strong>Translation Record Detail Page Layout</strong>, select <strong>Insert Section</strong> and then select <strong>Related Object</strong> from the picklist.</li>
    <li>In the <strong>Add Related Object Section</strong> dialog, complete the fields as follows and then select <strong>Done</strong>:
        <ul>
            <li><strong>Related Object</strong>: Translation Settings</li>
            <li><strong>Section Label</strong>: Literature Article Translation Settings</li>
            <li><strong>Section Name</strong>: literature_translation_settings__c</li>
            <li><strong>Criteria VQL</strong>: <br>
                <code>object_type__vr.api_name__v CONTAINS ('lit_article_translation_settings__v')</code></li>
        </ul>
    </li>
    <li>In the <strong>Literature Article Translation Settings</strong> section, select <strong>Edit Columns</strong> and ensure the following columns are added:
        <ul>
            <li>Number of Requests in Current Month</li>
            <li>Maximum Number of Requests per Month</li>
            <li>Maximum Number of Characters per Request</li>
        </ul></li>
</ol>

## Create Object Actions

Complete the following steps to add actions on the objects related to this feature:

### Literature Review Object
<ol>
    <li>Go to <strong>Admin > Configuration > Objects > Literature Review</strong>.</li>
    <li>On the <strong>Actions</strong> tab, select <strong>Create</strong>.</li>
    <li>In the <strong>Create Action</strong> window, select <strong>Translate Literature Abstracts</strong> and then select <strong>Continue</strong>.</li>
    <li>Make any required changes to the action and then save the page.</li>
    <!--<li>Repeat steps 1-4 to add the <strong>Cancel Translation Request</strong> action.</li>-->
</ol>

### Literature Article Object
<ol>
    <li>Go to <strong>Admin > Configuration > Objects > Literature Article</strong>.</li>
    <li>On the <strong>Actions</strong> tab, select <strong>Create</strong>.</li>
    <li>In the <strong>Create Action</strong> window, select <strong>Translate Literature Abstract</strong> and then select <strong>Continue</strong>.</li>
    <li>Make any required changes to the action and then save the page.</li>
    <!--<li>Repeat steps 1-4 to add the <strong>Cancel Translation Request</strong> action.</li>-->
</ol>

## Configure Object Lifecycles

Complete the following steps to set up the object lifecycles related to this feature.

### Configure Settings on the Literature Review Lifecycle

Go to **Admin > Configuration > Object Lifecycles > Literature Review Lifecycle** and complete the following steps to add a user action to the **New** and **Searching** states:

<ol>
    <li>In the <strong>States</strong> section, select <strong>New</strong>.</li>
    <li>In the <strong>User Actions</strong> section, select <strong>Edit</strong>.</li>
    <li>Select <strong>Create Rule</strong> and configure the following rule:
        <ul>
            <li><strong>Always ></strong> Translate Literature Abstracts</li>
            <li><strong>Action Label</strong>: Translate Literature Abstracts</li>
        </ul></li>
    <li>Save the page.</li>
    <!--<li>Return to the <strong>User Actions</strong> section and select <strong>Edit</strong>.</li>
    <li>Select <strong>Create Rule</strong> and configure the following rule:
        <ul>
            <li><strong>Always ></strong> Cancel Translation Request</li>
            <li><strong>Action Label</strong>: Cancel Translation Request</li>
        </ul></li>
    <li>Save the page.</li>-->
    <li>Repeat these steps for the <strong>Searching</strong> state.</li>
</ol>

### Configure Settings on the Literature Article Lifecycle

Go to **Admin > Configuration > Object Lifecycles > Literature Article Lifecycle** and complete the following steps:

#### Add Role

In the <strong>Roles</strong> section, add <strong>Aggregate Report Writer</strong>.

#### Update Role Permissions

In the <strong>Roles</strong> section, select <strong>Edit</strong> to update the role permissions as follows:
<table>
                        <thead>
                            <tr>
                                <th class="uk-width-2-5">Role</th>
                                <th class="uk-width-3-5">Permissions</th>
                            </tr>
                        </thead>
                        <tbody>
                            <tr>
                                <td>Aggregate Report Writer</td>
                                <td><ul>
                                    <li><strong>Translation Error</strong>: Remove all permissions</li>
                                    <li><strong>Abstract Translation Requested</strong>: Read</li>
                                    <li><strong>Abstract Translation Complete</strong>: Read</li>
                                    </ul></td>
                            </tr>
                            <tr>
                                <td>Editor</td>
                                <td><ul>
                                    <li><strong>Translation Error</strong>: Read</li>
                                    <li><strong>Abstract Translation Requested</strong>: Read, Edit</li>
                                    <li><strong>Abstract Translation Complete</strong>: Read, Edit</li>
                                    <li><strong>Pending Review</strong>: Read, Edit</li>
                                    <li><strong>Further Action in Progress</strong>: Read, Edit</li>
                                    <li><strong>Inactive</strong>: Read, Edit</li>
                                    <li><strong>In Review</strong>: Read, Edit</li>
                                    <li><strong>New</strong>: Read, Edit</li>
                                    </ul></td>
                            </tr>
                        </tbody>
                    </table>

#### Add a User Action to the New State

<ol>
    <li>In the <strong>States</strong> section, select <strong>New</strong>.</li>
    <li>In the <strong>User Actions</strong> section, select <strong>Edit</strong>.</li>
    <li>Select <strong>Create Rule</strong> and configure the following rule:
        <ul>
            <li><strong>Perform with conditions > If ></strong> Abstract Language <strong>is not equal to ></strong> English</li>
            <li><strong>Allow the following actions</strong>: Translate Literature Abstract</li>
            <li><strong>Action Label</strong>: Translate Literature Abstract</li>
        </ul></li>
    <li>Save the page.</li>
</ol>

<!--#### Add a User Action to the Abstract Translation Requested State

<ol>
    <li>In the <strong>States</strong> section, select <strong>Abstract Translation Requested</strong>.</li>
    <li>In the <strong>User Actions</strong> section, select <strong>Edit</strong>.</li>
    <li>Select <strong>Create Rule</strong> and configure the following rule:
        <ul>
            <li><strong>Always ></strong> Cancel Translation Request</li>
            <li><strong>Action Label</strong>: Cancel Translation Request</li>
        </ul></li>
    <li>Save the page.</li>
</ol>-->