# 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[](#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 [attributeA key-value pair that you associate with a person or an object—like a person’s name, the date they were created in your workspace, or a company’s billing date etc. Use attributes to target people and personalize messages.](/journeys/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 person’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 person’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[](#set-your-language-attribute)

To start translating messages, you’ll need to define how your workspace identifies people’s 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 [liquidA syntax that supports variables, letting you personalize messages for your audience. For example, if you want to reference a person’s first name, you might use the variable `{{customer.first_name}}`.](/using-liquid) or JavaScript.

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

## Convert language attributes to our standards[](#convert)

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 a campaign 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 a campaign 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 [segmentA group of people who match a series of conditions. People enter and exit the segment automatically when they match or stop matching conditions.](/journeys/data-driven-segments/) containing people with your original language attribute.
2.  Create a campaign.
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)](#adac7cc2cd0f9b453de0349593f841c1-lightbox)
    
4.  In your *Workflow*, drag **Create or update person** 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)](#a90b931cbee498f862a0f10e0dfcd7ea-lightbox)
        
    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 person from the segment you set up in the first step.

### Use liquid to convert language values[](#liquid-convert)

When you use the *Create or Update Person* action, you can set and modify attributes using [liquidA syntax that supports variables, letting you personalize messages for your audience. For example, if you want to reference a person’s first name, you might use the variable `{{customer.first_name}}`.](/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`:

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

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

```fallback
// 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:

```fallback
// 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[](#js-convert)

When you use the *Create or Update Person* 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`:

```javascript
// 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:

```javascript
// 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:

```javascript
// 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[](#supported-languages)

You must format the values of your language attribute as two-letter language codes with an optional two-letter region code separated by a dash, like `en` or `en-US`.

Language attribute values are **not case sensitive**, but language-region codes **must** be separated by a dash. For example, both `es-MX` and `es-mx` represent Spanish formatted for speakers in Mexico.

These codes come from the ISO-3166-1 (alpha 2) and IETF standards respectively. If you’re looking for a language or locale that we don’t support, [let us know](mailto:product@customer.io)!

Any code with an asterisk (\*) is not officially supported by our [auto-translate feature](/journeys/localization-getting-started/#how-translating-with-ai-works). You’ll have to use another service to get an accurate translation.

Code

Language/Locale

af

Afrikaans

af-ZA

Afrikaans (South Africa)

am-ET

Amharic (Ethiopia)

ar

Arabic

ar-AE

Arabic (U.A.E.)

ar-BH

Arabic (Bahrain)

ar-DZ

Arabic (Algeria)

ar-EG

Arabic (Egypt)

ar-IQ

Arabic (Iraq)

ar-JO

Arabic (Jordan)

ar-KW

Arabic (Kuwait)

ar-LB

Arabic (Lebanon)

ar-LY

Arabic (Libya)

ar-MA

Arabic (Morocco)

ar-OM

Arabic (Oman)

ar-QA

Arabic (Qatar)

ar-SA

Arabic (Saudi Arabia)

ar-SY

Arabic (Syria)

ar-TN

Arabic (Tunisia)

ar-YE

Arabic (Yemen)

arn-CL\*

Mapudungun (Chile)

as-IN

Assamese (India)

az

Azeri

az-Cyrl-AZ

Azeri (Cyrillic) (Azerbaijan)

az-Latn-AZ

Azeri (Latin) (Azerbaijan)

ba-RU\*

Bashkir (Russia)

be

Belarusian

be-BY

Belarusian (Belarus)

bg

Bulgarian

bg-BG

Bulgarian (Bulgaria)

bn-BD

Bengali (Bangladesh)

bn-IN

Bengali (India)

bo-CN\*

Tibetan (Peoples Republic of China)

bi\*

Bislama

br-FR\*

Breton (France)

bs-Cyrl-BA

Bosnian (Cyrillic) (Bosnia and Herzegovina)

bs-Latn-BA

Bosnian (Latin) (Bosnia and Herzegovina)

ca

Catalan

ca-ES

Catalan (Catalan)

co-FR

Corsican (France)

cs

Czech

cs-CZ

Czech (Czech Republic)

cy-GB

Welsh (United Kingdom)

da

Danish

da-DK

Danish (Denmark)

de

German

de-AT

German (Austria)

de-CH

German (Switzerland)

de-DE

German (Germany)

de-LI

German (Liechtenstein)

de-LU

German (Luxembourg)

dsb-DE\*

Lower Sorbian (Germany)

dv

Divehi

dv-MV

Divehi (Maldives)

el

Greek

el-GR

Greek (Greece)

en

English

en-029

English (Caribbean)

en-AT

English (Austria)

en-AU

English (Australia)

en-BE

English (Belgium)

en-BZ

English (Belize)

en-CA

English (Canada)

en-DE

English (Germany)

en-ES

English (Spain)

en-FR

English (France)

en-GB

English (United Kingdom)

en-IE

English (Ireland)

en-IN

English (India)

en-JM

English (Jamaica)

en-LU

English (Luxembourg)

en-MY

English (Malaysia)

en-NL

English (Netherlands)

en-NZ

English (New Zealand)

en-PH

English (Republic of the Philippines)

en-SG

English (Singapore)

en-TT

English (Trinidad and Tobago)

en-US

English (United States)

en-ZA

English (South Africa)

en-ZW

English (Zimbabwe)

es

Spanish

es-AR

Spanish (Argentina)

es-BO

Spanish (Bolivia)

es-CL

Spanish (Chile)

es-CO

Spanish (Colombia)

es-CR

Spanish (Costa Rica)

es-DO

Spanish (Dominican Republic)

es-EC

Spanish (Ecuador)

es-ES

Spanish (Spain)

es-GT

Spanish (Guatemala)

es-HN

Spanish (Honduras)

es-LA

Spanish (Latin America)

es-MX

Spanish (Mexico)

es-NI

Spanish (Nicaragua)

es-PA

Spanish (Panama)

es-PE

Spanish (Peru)

es-PR

Spanish (Puerto Rico)

es-PY

Spanish (Paraguay)

es-SV

Spanish (El Salvador)

es-US

Spanish (United States)

es-UY

Spanish (Uruguay)

es-VE

Spanish (Venezuela)

et

Estonian

et-EE

Estonian (Estonia)

eu

Basque

eu-ES

Basque (Basque)

fa

Persian

fa-IR

Persian (Iran)

fi

Finnish

fi-FI

Finnish (Finland)

fil-PH

Filipino (Philippines)

fo\*

Faroese

fo-FO\*

Faroese (Faroe Islands)

fr

French

fr-BE

French (Belgium)

fr-CA

French (Canada)

fr-CH

French (Switzerland)

fr-FR

French (France)

fr-LU

French (Luxembourg)

fr-MC

French (Principality of Monaco)

fy-NL

Frisian (Netherlands)

ga-IE

Irish (Ireland)

gd-GB

Scottish Gaelic (United Kingdom)

gl

Galician

gl-ES

Galician (Galician)

gsw-FR\*

Alsatian (France)

gu

Gujarati

gu-IN

Gujarati (India)

ha-Latn-NG

Hausa (Latin) (Nigeria)

he

Hebrew

he-IL

Hebrew (Israel)

hi

Hindi

hi-IN

Hindi (India)

hr

Croatian

hr-BA

Croatian (Latin) (Bosnia and Herzegovina)

hr-HR

Croatian (Croatia)

hsb-DE\*

Upper Sorbian (Germany)

hu

Hungarian

hu-HU

Hungarian (Hungary)

hy

Armenian

hy-AM

Armenian (Armenia)

id

Indonesian

id-ID

Indonesian (Indonesia)

ig-NG

Igbo (Nigeria)

ii-CN\*

Yi (Peoples Republic of China)

is

Icelandic

is-IS

Icelandic (Iceland)

it

Italian

it-CH

Italian (Switzerland)

it-IT

Italian (Italy)

iu-Cans-CA\*

Inuktitut (Syllabics) (Canada)

iu-Latn-CA\*

Inuktitut (Latin) (Canada)

ja

Japanese

ja-JP

Japanese (Japan)

ka

Georgian

ka-GE

Georgian (Georgia)

kk

Kazakh

kk-KZ

Kazakh (Kazakhstan)

kl-GL\*

Greenlandic (Greenland)

km-KH

Khmer (Cambodia)

kn

Kannada

kn-IN

Kannada (India)

ko

Korean

ko-KR

Korean (Korea)

kok\*

Konkani

kok-IN\*

Konkani (India)

ky

Kyrgyz

ky-KG

Kyrgyz (Kyrgyzstan)

la

Latin

lb-LU

Luxembourgish (Luxembourg)

lo-LA

Lao (Lao P.D.R.)

lt

Lithuanian

lt-LT

Lithuanian (Lithuania)

lv

Latvian

lv-LV

Latvian (Latvia)

mi-NZ

Maori (New Zealand)

mk

Macedonian

mk-MK

Macedonian (Former Yugoslav Republic of Macedonia)

ml-IN

Malayalam (India)

mn

Mongolian

mn-MN

Mongolian (Cyrillic) (Mongolia)

mn-Mong-CN

Mongolian (Traditional Mongolian) (Peoples Republic of China)

moh-CA\*

Mohawk (Canada)

mr

Marathi

mr-IN

Marathi (India)

ms

Malay

ms-BN

Malay (Brunei Darussalam)

ms-MY

Malay (Malaysia)

mt-MT

Maltese (Malta)

nb\*

Norwegian (Bokmål)

nb-NO\*

Norwegian, Bokmål (Norway)

ne-NP

Nepali (Nepal)

nl

Dutch

nl-BE

Dutch (Belgium)

nl-NL

Dutch (Netherlands)

nn-NO\*

Norwegian, Nynorsk (Norway)

no

Norwegian

nso-ZA\*

Sesotho sa Leboa (South Africa)

oc-FR\*

Occitan (France)

or-IN

Oriya (India)

pa

Punjabi

pa-IN

Punjabi (India)

pl

Polish

pl-PL

Polish (Poland)

prs-AF\*

Dari (Afghanistan)

ps-AF

Pashto (Afghanistan)

pt

Portuguese

pt-BR

Portuguese (Brazil)

pt-PT

Portuguese (Portugal)

qut-GT\*

Kiche (Guatemala)

quz-BO\*

Quechua (Bolivia)

quz-EC\*

Quechua (Ecuador)

quz-PE\*

Quechua (Peru)

rm-CH\*

Romansh (Switzerland)

ro

Romanian

ro-RO

Romanian (Romania)

ru

Russian

ru-RU

Russian (Russia)

rw-RW\*

Kinyarwanda (Rwanda)

sa\*

Sanskrit

sa-IN\*

Sanskrit (India)

sah-RU\*

Yakut (Russia)

se\*

Sami (Northern)

se-FI\*

Sami (Northern) (Finland)

se-NO\*

Sami (Northern) (Norway)

se-SE\*

Sami (Northern) (Sweden)

si-LK

Sinhala (Sri Lanka)

sk

Slovak

sk-SK

Slovak (Slovakia)

sl

Slovenian

sl-SI

Slovenian (Slovenia)

sm

Samoan

sma-NO\*

Sami (Southern) (Norway)

sma-SE\*

Sami (Southern) (Sweden)

smj-NO\*

Sami (Lule) (Norway)

smj-SE\*

Sami (Lule) (Sweden)

smn-FI\*

Sami (Inari) (Finland)

sms-FI\*

Sami (Skolt) (Finland)

so

Somali

so-DJ

Somali (Djibouti)

so-ET

Somali (Ethiopia)

so-KE

Somali (Kenya)

so-SO

Somali (Somalia)

sq

Albanian

sq-AL

Albanian (Albania)

sr

Serbian

sr-Cyrl-BA

Serbian (Cyrillic) (Bosnia and Herzegovina)

sr-Cyrl-CS

Serbian (Cyrillic) (Serbia and Montenegro (Former))

sr-Cyrl-ME

Serbian (Cyrillic) (Montenegro)

sr-Cyrl-RS

Serbian (Cyrillic) (Serbia)

sr-Latn-BA

Serbian (Latin) (Bosnia and Herzegovina)

sr-Latn-CS

Serbian (Latin) (Serbia and Montenegro (Former))

sr-Latn-ME

Serbian (Latin) (Montenegro)

sr-Latn-RS

Serbian (Latin) (Serbia)

sv

Swedish

sv-FI

Swedish (Finland)

sv-SE

Swedish (Sweden)

sw

Kiswahili

sw-KE

Kiswahili (Kenya)

syr\*

Syriac

syr-SY\*

Syriac (Syria)

ta

Tamil

ta-IN

Tamil (India)

te

Telugu

te-IN

Telugu (India)

tg-Cyrl-TJ

Tajik (Cyrillic) (Tajikistan)

th

Thai

to\*

Tonga (Tonga Islands)

th-TH

Thai (Thailand)

tk-TM\*

Turkmen (Turkmenistan)

tn-ZA\*

Setswana (South Africa)

tr

Turkish

tr-TR

Turkish (Turkey)

tt\*

Tatar

tt-RU\*

Tatar (Russia)

tzm-Latn-DZ\*

Tamazight (Latin) (Algeria)

ug-CN

Uyghur (Peoples Republic of China)

uk

Ukrainian

uk-UA

Ukrainian (Ukraine)

ur

Urdu

ur-PK

Urdu (Islamic Republic of Pakistan)

uz

Uzbek

uz-Cyrl-UZ

Uzbek (Cyrillic) (Uzbekistan)

uz-Latn-UZ

Uzbek (Latin) (Uzbekistan)

vi

Vietnamese

vi-VN

Vietnamese (Vietnam)

wo-SN\*

Wolof (Senegal)

xh-ZA

isiXhosa (South Africa)

yo-NG

Yoruba (Nigeria)

zh

Chinese

zh-CHS

Chinese (Simplified)

zh-Hans

Chinese (Simplified)

zh-CHT

Chinese (Traditional)

zh-Hant

Chinese (Traditional)

zh-CN

Chinese (Peoples Republic of China)

zh-HK

Chinese (Hong Kong S.A.R.)

zh-MO

Chinese (Macao S.A.R.)

zh-SG

Chinese (Singapore)

zh-TW

Chinese (Taiwan)

zu-ZA

isiZulu (South Africa)