# Translations

The "Translations" feature greatly simplifies the process of adding translations for Klaviyo attributes. With Mapping Translation Tables, you can now easily create and manage translation mappings, allowing you to provide localised and meaningful representations of attributes to achieve your specific requirements in Klaviyo. Whether you need to map category codes to descriptive names or convert abbreviations to full words, this feature has got you covered.

### **Key Features**

**Easy Setup**: Merchants can add a new "translation table" from the app. Each table is identified with a unique ID, such as "country\_name\_to\_country\_code".

<figure><img src="/files/KzjJgno8fZSymjp3zzvA" alt=""><figcaption></figcaption></figure>

**Add Rules**: Within a translation table, merchants can add rows consisting of "from" and "to" values. This allows for defining the translations between the original values (from) and the desired translated values (to).

<figure><img src="/files/KAxwFcEfNAZYWkAc6IeC" alt=""><figcaption></figcaption></figure>

**User-Friendly Interface**: The interface for managing translation tables is designed to be intuitive and easy to use, even with a large number of rows. Merchants can add translations one at a time or in bulk using a textarea input, with each translation on a separate line and separated by commas.

<figure><img src="/files/6OA9lx8SfmMtVIh7LwLv" alt=""><figcaption><p>Import multi lines in Buik Editor</p></figcaption></figure>

**Search Functionality**: Merchants can search within a translation table to quickly find a particular translation they are looking for.

<figure><img src="/files/xw7SxdtZ5GZpFYEh5oDE" alt=""><figcaption></figcaption></figure>

**Edit and Remove Translations**: Translations can be easily edited by clicking on the "from" or "to" value within a row. Additionally, merchants can remove translations by clicking a delete button associated with each row.

<figure><img src="/files/uEEBIkm608etYniWYIpf" alt=""><figcaption></figcaption></figure>

### **Using Translation Tables**

Once a translation table is defined, merchants can utilise it in the existing attribute mapper. Within the attribute template, merchants can specify a particular lookup translation table and output the translated "to" value. The syntax for this is as follows:

```
{{#translate}}translation_table_id::attribute_to_lookup{{/translate}}
```

In this syntax, "translation\_table\_id" refers to the ID of the translation table, and "attribute\_to\_lookup" is the attribute used to find the corresponding "from" value.

If a table entry for the "from" value is not found, the raw "from" value will be outputted into the template.

### Example Usages

Let's consider a scenario where a translation table named "country\_names\_to\_country\_codes" has been created to map the country names from Apparel21 to country codes in Klaviyo. Here's how you can utilise the Mapping Translation Tables feature:

**Set up a Translation Table**

On the translations page, create a new translation table with a name like "Country Names to Codes"

<img src="https://2650176838-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlsdUc9CfO9dlrBvzY7Ag%2Fuploads%2FwgakrAfXEXPblgLwry5H%2Fimage.png?alt=media&#x26;token=08ce0c60-4b1d-4c8d-af15-66e2f49729d9" alt="" width="563">

**Add Rules to the Translation Table**

Within the "country\_names\_to\_codes" translation table, add rows for each country name and its corresponding country code. Or using the Bulk Editor to import multiple rules at once. \
For instance:

* From: United States, To: US
* From: United Kingdom, To: UK
* From: Canada, To: CAN

<figure><img src="/files/0FDu5Y52ABe1K1jUhCuh" alt=""><figcaption></figcaption></figure>

**Utilise the Translation Table**

In the attribute mapper of the app, incorporate the translation table to display the country codes. In your mapping rule in [Mappings](broken://pages/xkrNfsgKfLO3Un5VmsRG), use the following syntax: \
\
`{{#translate}}country_names_to_codes::{{COUNTRY}}{{/translate}}`

<figure><img src="/files/sfJ1J6MSDiyJfhWUuVgW" alt=""><figcaption></figcaption></figure>

This template code retrieves the country name from the raw CSV data and uses the "country\_names\_to\_codes" translation table to output the corresponding country code. If a translation for a specific country name is not found in the table, the original country name will be displayed.

<img src="https://2650176838-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlsdUc9CfO9dlrBvzY7Ag%2Fuploads%2FSZcPGmdWAloPlYSY6oSv%2FScreenshot%202023-06-15%20at%204.31.56%20pm.png?alt=media&#x26;token=b085e899-8429-402c-b584-f5b335eaa212" alt="" width="100%">


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.dotapparel.com.au/customers/translations.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
