Skip to main content
Set each user’s language, then send the message variant that matches it across push, email, in-app, and SMS.

Prerequisites

  • The channel you want to send is already set up.
  • Each user has a language property. The mobile and web SDKs set it from the device language the first time the user is created. You can set and overwrite it. See Set the user’s language.

Choose how to localize each channel

OneSignal sends the message variant that matches the user’s language property. Use the table for what each channel sends when nothing matches.

Send one message per language segment

Every channel can send one message per language segment. Use this when each language needs its own message instead of variants on a single message.
  1. Create a segment for each language. Filter on Language and set the value to a code from Supported languages, such as fr or es.
  2. Create one message or template per language.
  3. Send each message to its segment.

Set the user’s language

The mobile and web SDKs set the language property from the device language when a user is first created. Update it later with any of these:
  1. The mobile SDK setLanguage method, or the web SDK setLanguage method.
  2. The language field on Create user or Update user.
  3. The language column in the CSV importer.
Pass a code from Supported languages. Most codes are ISO 639-1 two-letter codes. Chinese is the exception: use zh-Hans for Simplified and zh-Hant for Traditional. In email, push, and SMS, read the property in Liquid as user.language. In-app messages cannot read user.language. They can only substitute tags. See Why did my in-app message ignore setLanguage?.

Send messages in different languages

Open Messages > Push > New Message or a template, then click Add Languages.Option 1: CheckboxesSelect each language you support. The editor adds a tab per language. Recipients whose language you did not select receive the Any/English content.
Select Languages modal with checkboxes for each supported language

Select Languages modal with a checkbox for each supported language.

Option 2: Import a spreadsheet
1

Copy the template

From Add Languages, open the import option and copy the template.
Add Languages import modal with a spreadsheet template to copy

Import modal where you copy the spreadsheet template.

2

Fill one row per language

Use these column headers: language_code, title, subtitle, message. Include a row for en. These headers belong to this spreadsheet import. They are not the Dynamic Content CSV format.
3

Paste the sheet back and preview it

Paste the filled sheet into Add Languages and check the preview.
Add Languages modal showing pasted rows for language code, title, subtitle, and message

Import modal with language rows ready to insert.

4

Insert the content

Insert the rows. The editor adds a tab for each language and fills in the title, subtitle, and message.
Content preview showing a tab of imported copy for each language

Preview of imported content before it is inserted into the editor.

Option 3: Dynamic ContentUpload a CSV whose column headers are language codes (en, es, fr) and whose rows are message sections. Reference each cell with user.language. See Dynamic Content for the CSV shape and the Liquid.
The push editor stores text as HTML. In right-to-left languages, a character such as % can display in the wrong place. Add a right-to-left mark immediately after the character.
APISet contents to a map of language codes. Add headings for the title and subtitle for the iOS subtitle. Include en in every map, and use the same language codes in each map. en is required. Recipients whose language is not in the map receive the en text.Include headings for web push and Huawei. If you omit headings for web push, OneSignal uses your site name. subtitle is iOS only.
See Create message for targeting, scheduling, and the rest of the push fields.

Supported languages

Store one of these codes on the user’s language property. en is the required default for push and SMS. Most codes are ISO 639-1. zh-Hans (Simplified Chinese) and zh-Hant (Traditional Chinese) are script subtags, not two-letter codes.
If a code is not in this table, OneSignal does not offer it in the dashboard language picker or the import template. Use the closest supported language, or email support@onesignal.com to request the language.

FAQ

Why did a user receive the English message?

Their language property did not match a variant on the message, so OneSignal sent the default. In the dashboard that default is the Any/English tab. In the push and SMS APIs it is the en entry. Check the user’s language on their profile, then confirm that same code is a tab on the message or a key in contents.

What happens if I omit English?

Push and SMS contents require en. The push dashboard keeps the Any/English tab as the default for anyone whose language you did not add. Email and in-app tag conditionals use the else branch for every other language.

Can I localize email with a language map in the API?

No. Email email_subject and email_body are single strings. Branch on user.language with Liquid, use Dynamic Content, or send one template per language segment.

Why did my in-app message ignore setLanguage?

setLanguage updates the language property, and Add Languages uses that property. Liquid inside an in-app message does not. In-app Liquid can only read tags. Set a tag to the same code, such as de, and branch on that tag. The tag must be present before the user starts a new session.

How do I add languages to an existing in-app message?

Edit or duplicate the message. Either action migrates a single-language in-app message to the multi-language format. Until you do that, the message stays as it is.

Can I localize an in-app message in a Journey?

Yes. Add Languages works on in-app steps in a Journey, in both the block editor and the HTML editor.

Why does punctuation break in Arabic or Hebrew?

The push editor stores text as HTML. A character such as % can display in the wrong place in a right-to-left language. Add a right-to-left mark immediately after the character.

Dynamic Content

Upload a CSV whose columns are language codes and insert the matching cell with Liquid.

Using Liquid syntax

Branch message content with conditionals, filters, and fallbacks.

Properties and tags

Read user.language and other stored properties in Liquid.

Segmentation

Build a segment filtered on Language and send one message per language.