Set up your localization attribute

Updated

Before you can set up multi-language messages, you need to store your audience’s language preferences as an attribute. You can tell us what that attribute is, and then use it to send people messages in their preferred language!

How it works

Before you can send localized messages, you need to go to Workspace Settings > Language settings and tell us what 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. Attributes are analogous to traits in Data Pipelines. stores your audience’s language preferences. This attribute must store values we support, 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 languages for your message. If a person’s language attribute doesn’t match one of the languages in your message, they’ll receive the Default message.

flowchart LR C[Multi-language
message] --> D{Does a person's language
attribute match a message?} D -->|no| H[Person gets
Default message] D -->|yes, lang=es| E[Person gets
Spanish message] D -->|yes, lang=fr| F[Person gets
French message] D -->|yes, lang=de| G[Person gets
German message]

If you already store languages in a format that doesn’t fit our standards, you may be able to convert your current value(s) 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}}. or JavaScript.

Set your language attribute

When you add a language attribute, we assume that values fit our list of supported languages. If you already have a “language attribute”, but it doesn’t use our supported values, you may want to create a new attribute and set up a campaign to convert your existing attribute to our supported formats.

Before you can send localized messages, you need to go to Workspace Settings > Language settings and tell us what 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. Attributes are analogous to traits in Data Pipelines. stores your audience’s language preferences. This attribute must store values we support, 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.

To set your workspace’s language attribute:

  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.
Set your localization settings
Set your localization settings

Convert language attributes to our standards

If you already store your audience’s language preference in a format that doesn’t fit ISO-3166-1 (alpha 2) or IETF standards, you can set up a campaign to reformat your language attribute.

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. containing people with your original language attribute.
  2. Create a campaign. Click “Segment change” as the trigger type. On the Trigger page:
    1. Click Choose segment.
    2. Choose the segment you just created from the dropdown.
    3. Click Save condition.
      Select a segment containing people with your original language attribute
      Select a segment containing people with your original language attribute
    4. Click Save & Next.
  3. In your Workflow, drag Create or update person onto the canvas.
    1. Give the action a Name, and click Add Details.
    2. Under attribute, type the name of the language attribute you set in Language settings.
    3. Select Liquid or JavaScript, and write an expression to convert or map languages. We’ve provided some examples below.
      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.
      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.
    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

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}}.. 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 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 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:

// 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

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 attributes 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!

CodeLanguage/Locale
afAfrikaans
af-ZAAfrikaans (South Africa)
am-ETAmharic (Ethiopia)
arArabic
ar-AEArabic (U.A.E.)
ar-BHArabic (Bahrain)
ar-DZArabic (Algeria)
ar-EGArabic (Egypt)
ar-IQArabic (Iraq)
ar-JOArabic (Jordan)
ar-KWArabic (Kuwait)
ar-LBArabic (Lebanon)
ar-LYArabic (Libya)
ar-MAArabic (Morocco)
ar-OMArabic (Oman)
ar-QAArabic (Qatar)
ar-SAArabic (Saudi Arabia)
ar-SYArabic (Syria)
ar-TNArabic (Tunisia)
ar-YEArabic (Yemen)
arn-CLMapudungun (Chile)
as-INAssamese (India)
azAzeri
az-Cyrl-AZAzeri (Cyrillic) (Azerbaijan)
az-Latn-AZAzeri (Latin) (Azerbaijan)
ba-RUBashkir (Russia)
beBelarusian
be-BYBelarusian (Belarus)
bgBulgarian
bg-BGBulgarian (Bulgaria)
bn-BDBengali (Bangladesh)
bn-INBengali (India)
bo-CNTibetan (Peoples Republic of China)
biBislama
br-FRBreton (France)
bs-Cyrl-BABosnian (Cyrillic) (Bosnia and Herzegovina)
bs-Latn-BABosnian (Latin) (Bosnia and Herzegovina)
caCatalan
ca-ESCatalan (Catalan)
co-FRCorsican (France)
csCzech
cs-CZCzech (Czech Republic)
cy-GBWelsh (United Kingdom)
daDanish
da-DKDanish (Denmark)
deGerman
de-ATGerman (Austria)
de-CHGerman (Switzerland)
de-DEGerman (Germany)
de-LIGerman (Liechtenstein)
de-LUGerman (Luxembourg)
dsb-DELower Sorbian (Germany)
dvDivehi
dv-MVDivehi (Maldives)
elGreek
el-GRGreek (Greece)
enEnglish
en-029English (Caribbean)
en-ATEnglish (Austria)
en-AUEnglish (Australia)
en-BEEnglish (Belgium)
en-BZEnglish (Belize)
en-CAEnglish (Canada)
en-DEEnglish (Germany)
en-ESEnglish (Spain)
en-FREnglish (France)
en-GBEnglish (United Kingdom)
en-IEEnglish (Ireland)
en-INEnglish (India)
en-JMEnglish (Jamaica)
en-LUEnglish (Luxembourg)
en-MYEnglish (Malaysia)
en-NLEnglish (Netherlands)
en-NZEnglish (New Zealand)
en-PHEnglish (Republic of the Philippines)
en-SGEnglish (Singapore)
en-TTEnglish (Trinidad and Tobago)
en-USEnglish (United States)
en-ZAEnglish (South Africa)
en-ZWEnglish (Zimbabwe)
esSpanish
es-ARSpanish (Argentina)
es-BOSpanish (Bolivia)
es-CLSpanish (Chile)
es-COSpanish (Colombia)
es-CRSpanish (Costa Rica)
es-DOSpanish (Dominican Republic)
es-ECSpanish (Ecuador)
es-ESSpanish (Spain)
es-GTSpanish (Guatemala)
es-HNSpanish (Honduras)
es-LASpanish (Latin America)
es-MXSpanish (Mexico)
es-NISpanish (Nicaragua)
es-PASpanish (Panama)
es-PESpanish (Peru)
es-PRSpanish (Puerto Rico)
es-PYSpanish (Paraguay)
es-SVSpanish (El Salvador)
es-USSpanish (United States)
es-UYSpanish (Uruguay)
es-VESpanish (Venezuela)
etEstonian
et-EEEstonian (Estonia)
euBasque
eu-ESBasque (Basque)
faPersian
fa-IRPersian (Iran)
fiFinnish
fi-FIFinnish (Finland)
fil-PHFilipino (Philippines)
foFaroese
fo-FOFaroese (Faroe Islands)
frFrench
fr-BEFrench (Belgium)
fr-CAFrench (Canada)
fr-CHFrench (Switzerland)
fr-FRFrench (France)
fr-LUFrench (Luxembourg)
fr-MCFrench (Principality of Monaco)
fy-NLFrisian (Netherlands)
ga-IEIrish (Ireland)
gd-GBScottish Gaelic (United Kingdom)
glGalician
gl-ESGalician (Galician)
gsw-FRAlsatian (France)
guGujarati
gu-INGujarati (India)
ha-Latn-NGHausa (Latin) (Nigeria)
heHebrew
he-ILHebrew (Israel)
hiHindi
hi-INHindi (India)
hrCroatian
hr-BACroatian (Latin) (Bosnia and Herzegovina)
hr-HRCroatian (Croatia)
hsb-DEUpper Sorbian (Germany)
huHungarian
hu-HUHungarian (Hungary)
hyArmenian
hy-AMArmenian (Armenia)
idIndonesian
id-IDIndonesian (Indonesia)
ig-NGIgbo (Nigeria)
ii-CNYi (Peoples Republic of China)
isIcelandic
is-ISIcelandic (Iceland)
itItalian
it-CHItalian (Switzerland)
it-ITItalian (Italy)
iu-Cans-CAInuktitut (Syllabics) (Canada)
iu-Latn-CAInuktitut (Latin) (Canada)
jaJapanese
ja-JPJapanese (Japan)
kaGeorgian
ka-GEGeorgian (Georgia)
kkKazakh
kk-KZKazakh (Kazakhstan)
kl-GLGreenlandic (Greenland)
km-KHKhmer (Cambodia)
knKannada
kn-INKannada (India)
koKorean
ko-KRKorean (Korea)
kokKonkani
kok-INKonkani (India)
kyKyrgyz
ky-KGKyrgyz (Kyrgyzstan)
laLatin
lb-LULuxembourgish (Luxembourg)
lo-LALao (Lao P.D.R.)
ltLithuanian
lt-LTLithuanian (Lithuania)
lvLatvian
lv-LVLatvian (Latvia)
mi-NZMaori (New Zealand)
mkMacedonian
mk-MKMacedonian (Former Yugoslav Republic of Macedonia)
ml-INMalayalam (India)
mnMongolian
mn-MNMongolian (Cyrillic) (Mongolia)
mn-Mong-CNMongolian (Traditional Mongolian) (Peoples Republic of China)
moh-CAMohawk (Canada)
mrMarathi
mr-INMarathi (India)
msMalay
ms-BNMalay (Brunei Darussalam)
ms-MYMalay (Malaysia)
mt-MTMaltese (Malta)
nbNorwegian (Bokmål)
nb-NONorwegian, Bokmål (Norway)
ne-NPNepali (Nepal)
nlDutch
nl-BEDutch (Belgium)
nl-NLDutch (Netherlands)
nn-NONorwegian, Nynorsk (Norway)
noNorwegian
nso-ZASesotho sa Leboa (South Africa)
oc-FROccitan (France)
or-INOriya (India)
paPunjabi
pa-INPunjabi (India)
plPolish
pl-PLPolish (Poland)
prs-AFDari (Afghanistan)
ps-AFPashto (Afghanistan)
ptPortuguese
pt-BRPortuguese (Brazil)
pt-PTPortuguese (Portugal)
qut-GTKiche (Guatemala)
quz-BOQuechua (Bolivia)
quz-ECQuechua (Ecuador)
quz-PEQuechua (Peru)
rm-CHRomansh (Switzerland)
roRomanian
ro-RORomanian (Romania)
ruRussian
ru-RURussian (Russia)
rw-RWKinyarwanda (Rwanda)
saSanskrit
sa-INSanskrit (India)
sah-RUYakut (Russia)
seSami (Northern)
se-FISami (Northern) (Finland)
se-NOSami (Northern) (Norway)
se-SESami (Northern) (Sweden)
si-LKSinhala (Sri Lanka)
skSlovak
sk-SKSlovak (Slovakia)
slSlovenian
sl-SISlovenian (Slovenia)
smSamoan
sma-NOSami (Southern) (Norway)
sma-SESami (Southern) (Sweden)
smj-NOSami (Lule) (Norway)
smj-SESami (Lule) (Sweden)
smn-FISami (Inari) (Finland)
sms-FISami (Skolt) (Finland)
soSomali
so-DJSomali (Djibouti)
so-ETSomali (Ethiopia)
so-KESomali (Kenya)
so-SOSomali (Somalia)
sqAlbanian
sq-ALAlbanian (Albania)
srSerbian
sr-Cyrl-BASerbian (Cyrillic) (Bosnia and Herzegovina)
sr-Cyrl-CSSerbian (Cyrillic) (Serbia and Montenegro (Former))
sr-Cyrl-MESerbian (Cyrillic) (Montenegro)
sr-Cyrl-RSSerbian (Cyrillic) (Serbia)
sr-Latn-BASerbian (Latin) (Bosnia and Herzegovina)
sr-Latn-CSSerbian (Latin) (Serbia and Montenegro (Former))
sr-Latn-MESerbian (Latin) (Montenegro)
sr-Latn-RSSerbian (Latin) (Serbia)
svSwedish
sv-FISwedish (Finland)
sv-SESwedish (Sweden)
swKiswahili
sw-KEKiswahili (Kenya)
syrSyriac
syr-SYSyriac (Syria)
taTamil
ta-INTamil (India)
teTelugu
te-INTelugu (India)
tg-Cyrl-TJTajik (Cyrillic) (Tajikistan)
thThai
toTonga (Tonga Islands)
th-THThai (Thailand)
tk-TMTurkmen (Turkmenistan)
tn-ZASetswana (South Africa)
trTurkish
tr-TRTurkish (Turkey)
ttTatar
tt-RUTatar (Russia)
tzm-Latn-DZTamazight (Latin) (Algeria)
ug-CNUyghur (Peoples Republic of China)
ukUkrainian
uk-UAUkrainian (Ukraine)
urUrdu
ur-PKUrdu (Islamic Republic of Pakistan)
uzUzbek
uz-Cyrl-UZUzbek (Cyrillic) (Uzbekistan)
uz-Latn-UZUzbek (Latin) (Uzbekistan)
viVietnamese
vi-VNVietnamese (Vietnam)
wo-SNWolof (Senegal)
xh-ZAisiXhosa (South Africa)
yo-NGYoruba (Nigeria)
zhChinese
zh-CHSChinese (Simplified)
zh-HansChinese (Simplified)
zh-CHTChinese (Traditional)
zh-HantChinese (Traditional)
zh-CNChinese (Peoples Republic of China)
zh-HKChinese (Hong Kong S.A.R.)
zh-MOChinese (Macao S.A.R.)
zh-SGChinese (Singapore)
zh-TWChinese (Taiwan)
zu-ZAisiZulu (South Africa)
Copied to clipboard!
  Contents
Is this page helpful?