Internationalize your widget

The widget and portal support 11 languages. Learn how the language is detected, how to set it with the locale option, and how to translate your own Messenger text.

JM
James Morton
Written By James MortonLast updated 1 day ago

The widget and portal detect each visitor's language and show all interface text (buttons, labels, placeholders) in it. This article lists the supported languages, explains how the language is chosen, and shows how to set it yourself.

Supported languages

Code

Language

Direction

en

English

Left to right (default)

de

German

Left to right

fr

French

Left to right

es

Spanish

Left to right

ar

Arabic

Right to left

ru

Russian

Left to right

pt-br

Portuguese (Brazil)

Left to right

zh-cn

Chinese, Simplified

Left to right

zh-tw

Chinese, Traditional

Left to right

nl

Dutch

Left to right

pl

Polish

Left to right

Codes are not case-sensitive, so the widget's locale option also accepts pt-BR, zh-CN, and zh-TW.

How the language is chosen

The widget and portal pick a language in this order:

  1. URL parameter: ?locale=fr overrides everything else.
  2. Widget SDK option: the locale you pass to init (see below).
  3. Browser language: the browser's Accept-Language header.
  4. English: the fallback when nothing matches.

Region subtags are dropped automatically, so a browser sending fr-FR gets fr.

Note: Chinese is matched by script rather than region: tags that resolve to Traditional script (zh-TW, zh-HK, zh-Hant) get zh-tw, and everything else under zh gets zh-cn.

Set the language in the widget

Pass locale when you initialize the widget:

Quackback("init", {
  locale: "de",
});

The widget renders in German right away.

Tip: If your app lets users choose a language, pass their choice here so the widget matches the rest of your product, whatever the browser reports.

Translate your own Messenger text

Interface text is translated for you. Text you write yourself is not. To show your Messenger welcome and offline messages in other languages, add them under Translations in Settings > Support > Channels > Messenger.

Portal language

The portal reads the browser's language and switches automatically. There is no admin setting to configure. Visitors on Arabic get a right-to-left layout.

Test a right-to-left layout

Add ?rtl=1 to a portal URL to force right-to-left rendering:

https://feedback.example.com/?rtl=1

This is a testing tool only. In normal use, right-to-left layout turns on automatically for Arabic. Do not use it in links you share with users.

Was this helpful?

Your feedback shapes what we write next.