Multilingual AI
Overview
Shopper-facing replies use an allow-list of languages. This is separate from translating wp-admin.
Supported languages (verified)
Auto Detect, English, Spanish, French, German, Italian, Portuguese, Arabic, Bengali, Hindi, Chinese, Japanese.
No other languages are supported. Invalid settings become Auto Detect. Unsupported detected languages fall back to English (Language_Catalog::DEFAULT_CODE = en) where a code is required.
How It Works
- Merchant sets AI Language (
autoor a code). - If fixed: every reply uses that code (overrides detection).
- If Auto Detect:
Language_Detectorinspects the message; optional session memory stores the code on the conversation; WordPress locale can seed bootstrap. - System prompt includes the English language name for the model.
- Widget sets
dir="rtl"for Arabic. - Fallback strings are chosen from the same allow-list.
The browser cannot POST a language to force replies (Language_Resolver does not trust client-supplied language).
How to Enable It
WooCommerce → AI Assistant → Settings → AI Language.
Configuration
Frontend Usage
Shoppers write in their language. With Auto Detect + Remember, the chat stays in that language until they clearly switch.
Example
Bengali first message on Auto Detect → Bengali LLM replies (if AI is up) and Bengali fallback strings if AI is down — unless Appearance Welcome Message was customized in English.
Behavior
| Situation | What happens |
|---|---|
| Auto Detect | Per message + optional session memory |
| Fixed language | Always that language |
| Remember off | Re-detect more often |
| AI unavailable | Static fallback map for the resolved code |
| Appearance welcome saved | Overrides language-aware welcome |
Limitations
- Detection is heuristic, not a full CLD library.
- Admin UI language follows WordPress locale /
languages/(no.potshipped yet — Domain Path is/languages). - Chinese is a single
zhcode (not separate Simplified/Traditional settings).
Troubleshooting
Wrong language: set a fixed language. Welcome always English: clear Appearance Welcome Message. RTL issues: only Arabic is marked RTL.