Skip to main content
Pass a language prop to the widget and Crow handles the rest — the AI responds in that language and the welcome message is translated automatically. Example: Your platform has users who speak Spanish, Japanese, and French. Set language="es" for Spanish users and the entire experience adapts — no prompt engineering needed.

How It Works

1. You pass a language code (ISO 639-1) when embedding the widget
2. Crow translates the welcome message on the fly
3. A language instruction is injected into the AI's system prompt
4. The AI responds in the specified language for the entire conversation
When no language is passed (or language="en"), behavior is unchanged — fully backward compatible.

Pass Language to Widget

Add data-language to the script tag:
<script
  src="https://api.usecrow.org/static/crow-widget.js"
  data-api-url="https://api.usecrow.org"
  data-product-id="YOUR_PRODUCT_ID"
  data-language="es"
></script>
AttributeRequiredDescription
data-languageNoISO 639-1 language code (e.g., es, fr, ja)
You can set language dynamically based on the logged-in user’s locale, browser settings, or any other runtime value. For example:
const language = user.locale || navigator.language.split('-')[0];

<CrowWidget language={language} ... />

What Gets Translated

ElementBehavior
Welcome messageTranslated automatically when the widget loads (uses a fast LLM call)
AI responsesAll replies are in the specified language for the entire conversation
Error messages from the AIAlso in the specified language
Widget UI chromeNot translated (buttons, placeholders remain in English)

Supported Languages

Crow supports the following ISO 639-1 codes:
CodeLanguageCodeLanguageCodeLanguage
afAfrikaanshrCroatiannlDutch
amAmharichuHungariannoNorwegian
arArabichyArmenianpaPunjabi
azAzerbaijaniidIndonesianplPolish
beBelarusianisIcelandicptPortuguese
bgBulgarianitItalianroRomanian
bnBengalijaJapaneseruRussian
bsBosniankaGeorgiansiSinhala
caCatalankkKazakhskSlovak
csCzechkmKhmerslSlovenian
cyWelshknKannadasqAlbanian
daDanishkoKoreansrSerbian
deGermanloLaosvSwedish
elGreekltLithuanianswSwahili
enEnglishlvLatviantaTamil
esSpanishmkMacedonianteTelugu
etEstonianmlMalayalamthThai
faPersianmnMongoliantlFilipino
fiFinnishmrMarathitrTurkish
frFrenchmsMalayukUkrainian
gaIrishmyBurmeseurUrdu
glGalicianneNepaliuzUzbek
guGujarativiVietnamese
heHebrewzhChinese
hiHindizuZulu
Passing an unsupported code returns a 422 validation error.

Behavior Details

ScenarioBehavior
language not passedEnglish (default) — no changes to current behavior
language="en"English — no translation or prompt injection
language="es"Welcome message translated to Spanish, AI responds in Spanish
Unsupported language code422 error returned by the API
Welcome message is nullThe SDK default (“Hi! How can I help you today?”) is translated
Translation failsFalls back to the original English text silently

Troubleshooting

IssueSolution
422 error on chatCheck the language code is a valid ISO 639-1 code from the table above
Welcome message still in EnglishVerify data-language / language prop is set and not "en"
AI responds in wrong languageCheck the language code is correct — zh for Chinese, pt for Portuguese, etc.
Mixed languages in responseThis can happen if the user writes in a different language. The AI prioritizes the configured language but may adapt to user input