> This page is part of the [Customer.io documentation](https://docs.customer.io). For the complete index, see [llms.txt](https://docs.customer.io/llms.txt).

# Set up your localization attribute

Before you can set up multi-language messages, you need to store your audience's language preferences as an attribute. Then you'll assign this in your language settings so we send the right translation to your recipients.

## How it works

To set up your workspace to send translated messages, you’ll follow these steps:

1.  Store your audience’s language preferences as an attribute on their profiles.
2.  Assign this attribute in your language settings.

You’ll indicate which [attribute](/journeys/people/manage/attributes/) contains your audience’s language preferences in [**Workspace Settings** > **Language settings**](https://fly.customer.io/workspaces/last/settings/language). This attribute must store [values we support](#supported-languages), meaning they’re either:

*   A two-letter language code, like `en` for English
*   A four-letter language and region code, separated by a dash, like `en-US` for English speakers in the United States

We’ll match your customers’ attribute values to the corresponding translations of your messages. If a profile’s language attribute doesn’t match one of the languages in your message, they’ll receive the *Default* message.

Localization matching is strict

We don’t resolve or “fall back” from four-letter locale codes (like `nl-BE`) to two-letter codes (like `nl`). If a profile’s localization attribute doesn’t match a language in your message exactly, they’ll receive the *Default* message. Make sure that you set your attributes exactly as you plan to use them in your messages.

## Set your language attribute

To start translating messages, you’ll need to define how your workspace identifies profiles’ language preferences. To set your workspace’s language setting:

1.  Go to **Settings** > **Workspace Settings**.
2.  Find *Language settings* and click **Get Started**.
3.  Enter the name of the attribute representing your audience’s language. Remember you must [store values in a certain format](#how-it-works). If you store languages that don’t follow our standard, you can [convert them](#convert) with [liquid](/journeys/liquid/using-liquid) or JavaScript.

 ![Set your localization settings](https://docs.customer.io/images/localization-settings.png)

## Convert language attributes to our standards

If you already store your audience’s language preferences in a format that doesn’t fit [ISO-3166-1 (alpha 2) or IETF standards](#supported-languages), you can set up an automation to reformat your language attribute. If you can, it’s best to also update your integrations so they send the correct format moving forward.

Below is an example of an automation you could create to reformat a language attribute with underscores instead of dashes between the language and region. In the workflow, you create a new attribute to store the reformatted preference, in case integrations continue to add or update people with a language preference that you need to reformat.

1.  Create a [segment](/journeys/segmentation/data-driven-segments/) containing people with your original language attribute.
2.  Create an automation.
3.  Click the trigger on the canvas, and click **Attribute or Segment** as the trigger type. Choose the segment you just created from the dropdown.

    ![Select a segment containing people with your original language attribute](https://docs.customer.io/images/localization-attribute-segment-1.png)

4.  In your *Workflow*, drag **Create or update profile** onto the canvas.
    1.  Give the action a **Name**, then click **Add Details**.
    2.  Click **Add attribute**. Type the name of the language attribute you set in [Language settings](https://fly.customer.io/workspaces/last/settings/language).

         ![Under which attributes do you want to add, change or remove, there are two attributes listed. The first is language-standard. The value is set to liquid where the value for the attribute language-original is updated to a standard format and saved on this new attribute. The second attribute is language-original and the value is Remove attribute.](https://docs.customer.io/images/localization-create-update-action.png)

    3.  Select [*Liquid*](#liquid-convert) or [*JavaScript*](#js-convert), and write an expression to convert or map languages. We’ve provided some examples below.
    4.  Under *Sample Data*, click next to the original attribute.
    5.  Set the value to **Remove attribute**. This removes the original language attribute *and* removes the profile from the segment you set up in the first step.

### Use liquid to convert language values

When you use the *Create or Update Profile* action, you can set and modify attributes using [liquid](/journeys/liquid/using-liquid). The liquid expression you use to map your old language attribute to your new one depends on your current language format, but we’ve provided some ideas below.

If you store languages with an underscore instead of a dash (e.g. `en_US` instead of `en-US`), you can replace the underscore easily with `replace`:

```
// assume input en_us
{{ customer.language | replace: "_", "-" }}
// outputs en-us
```

If you store languages without a delimiter, you can add one by [slicing](/messaging/liquid/tag-list/#slice) your original language attribute:

```
// assume input enUS
{{ customer.language | slice: 2 }}-{{customer.language | slice: 3, 2}}
// output
```

Or, if you store languages as full names, you may need to map some of them. You can do this with condtitions:

```
// assume languages are english, french, and german
{% if customer.language == "German" %}
    de
    // output for german
{% else %}
    {{customer.language | slice: 2, 2}}
    // for french and english, use the first two letters of language code
{% end %}
```

### Use JavaScript to convert language values

When you use the *Create or Update Profile* action, you can set and modify attributes using JavaScript. The liquid expression you use to map your old language attribute to your new one depends on your current language format, but we’ve provided some ideas below.

If you store languages with an underscore instead of a dash (e.g. `en_US` instead of `en-US`), you can replace the underscore easily with `replace`:

```
// assume `language` attribute formatted en_us
return customer.language.replace("_", "-");
// outputs en-us
```

If you store languages without a delimiter, you can add one by slicing your original language attribute:

```
// assume `language` attribute formatted enUS
return customer.language.slice(0, 2) + "-" + customer.language.slice(2);
// output
```

Or, if you store languages as full names, you may need to map some of them. You can do this with condtitions:

```
// assume languages are english, french, and german
if (customer.language == "German") {
    return de;
    // output for german
} else {
    customer.language.slice(0, 2);
    // for french and english, use the first two letters of language code
}
```

## Supported languages and locales

{{% include “localization-supported-languages.html” %}}

©2026 Peaberry Software, Inc. [Status](https://status.customerio.com/) [Terms of Service](https://customer.io/legal/terms-of-service/) [Privacy Policy](https://customer.io/legal/privacy-policy/)

[](https://www.linkedin.com/company/customer-io)[](https://twitter.com/customerio)[](https://www.youtube.com/channel/UCkCaWdezRoa8ZyR9pEVaipA)[](https://www.instagram.com/customer.io/)
