E-commerce
July 1, 2026
Message 1 in French. Message 3 in English. The bot remains in FR and loses the customer.
An e-commerce code-switching AI chatbot detects the language at each turn, tracks the customer's shift, confirms if necessary, and responds in the active language without forcing monolingualism.
This guide #892 covers bot_codeswitch_* intents, CODESWITCHbot flow CSB-1 to CSB-8, and codeswitch_bot KPIs. Bot pair from the MIXLANG playbook (#891). Use case: language change during a widget interaction.
Summary
Why use code-switching on the bot side?
A bot frozen in FR ignores "where is my package". FOLLOW-CLIENT-LANG-BOT and DETECT-PER-MESSAGE-BOT reduce mixlang_ tickets #891 without replacing the multilingual strategy #16.
What code-switching solves
Language change: client switches FR → EN mid-chat
Hybrid message: parses FR+EN in the same turn
Mismatched response: bot responds in the wrong language
Unclear preference: confirm_lang before lock
Fewer tickets: reduction in mixlang_bot_wrong_lang
Retail DTC Example
DTC EU Fashion, FOLLOW-CLIENT-LANG active. codeswitch_bot_mixlang_deflect +31%, codeswitch_bot_wrong_lang_rate -42% over 5 weeks.
CODESWITCHbot #892 vs MIXLANG #891, MULTI #16, LOCAL #267 and LANG #890
Five multilingual contents, five distinct roles.
Quick matrix
#892 CODESWITCHbot: detect track language per widget message
MIXLANG #891: agents manage mixed-language tickets ML-5
MULTI #16: multilingual bot strategy store
LOCAL #267: localization tone international adaptation
KB #268: base multilingual answers structure
LANG #890: FR mistakes distinct code-switch
Pipeline: customer language switch → #892 tracks → mixlang_ #891 decrease.
Which bot_codeswitch_* intents should be configured?
Eight dynamic multilingual intents mapped MIXLANG-MAP #891.
Eight bot_codeswitch intents
bot_codeswitch_detect: dominant language message map
bot_codeswitch_follow: adapt response to detected language map
bot_codeswitch_lock_pref: store confirmed preference map
bot_codeswitch_hybrid_parse: extract intent from FR+EN message map
bot_codeswitch_confirm_lang: ask FR or EN map
bot_codeswitch_respond_match: full response in active language map
bot_codeswitch_bilingual_fallback: short FR+EN summary if uncertain map
bot_codeswitch_mixlang_feed: consume LOG #891 map
Each turn logs detected_lang response_lang switch_detected.
How should MIXLANG-MAP #891 be consumed?
The bot reads MIXLANG-MAP #891 + i18n fields: supported_langs, detect_threshold, switch_confirm_on_change, hybrid_parse_enabled, mixlang_feed_priority.
Code-switching guardrails
FOLLOW-CLIENT-LANG-BOT: response in current message language
DETECT-PER-MESSAGE-BOT: re-detection each turn, no frozen session
NO-FORCE-SINGLE-LANG-BOT: do not force FR if client is EN
CONFIRM-ON-SWITCH-BOT: confirm_lang if sudden switch
RESPOND-MATCH-BOT: content AND language aligned
BILINGUAL-FALLBACK-BOT: two lines if detection is uncertain
MIXLANG-FEED-LOOP-BOT: mixlang_feed corrects wrong_lang
CODESWITCHBOT-SUP policy in six rules
Six dynamic, responsive multilingual rules.
FOLLOW-CLIENT-LANG-BOT: follow active client language
DETECT-PER-MESSAGE-BOT: detection on every message
CONFIRM-ON-SWITCH-BOT: confirm notable language change
RESPOND-MATCH-BOT: reply in the same language as client
BILINGUAL-FALLBACK-BOT: short FR+EN if ambiguous
MIXLANG-FEED-LOOP-BOT: LOG #891 review within 48 hours
Flow CODESWITCHbot CSB-1 to CSB-8
Eight-step flow: incoming message detection switch response log feed.
CSB-1 Ingest message: raw customer text
CSB-2 Lang detect: bot_codeswitch_detect per message
CSB-3 Switch check: language ≠ previous turn? confirm or follow
CSB-4 Hybrid parse: if mixlang_hybrid extract intent
CSB-5 Intent resolve: CS in active language KB #268
CSB-6 Respond match: respond_match or bilingual_fallback
CSB-7 Lock pref: lock_pref if customer confirms
CSB-8 Log: detected_lang response_lang mixlang_deflect feed
Example TPL-CODESWITCHbot-FOLLOW
EN client → EN response map. FOLLOW-CLIENT-LANG-BOT. No FR blending in EN body.
TPL-CODESWITCHbot and touchpoints templates
Four short code-switching embed templates.
TPL-CODESWITCHbot-CONFIRM
[confirm_lang_copy : Continue in English ? / Continuer en français ?] CONFIRM-ON-SWITCH.
TPL-CODESWITCHbot-FOLLOW
[active_language answer map.] RESPOND-MATCH-BOT.
TPL-CODESWITCHbot-BILINGUAL
[FR line map.] [EN line map.] BILINGUAL-FALLBACK if uncertain.
TPL-CODESWITCHbot-HYBRID
[resolved_intent map.] hybrid_parse then FOLLOW dominant language.
Touchpoints
First EN message : immediate follow, do not force FR
Switch FR→EN turn 4 : confirm_lang or follow depending on config
Hybrid message : hybrid_parse + bilingual if needed
LOG MIXLANG #891 : mixlang_feed wrong_lang fix
Edge cases and reroutes
Five cases out of the standard flow.
Unsupported language: bilingual_fallback FR+EN + handoff #891
Three languages in the same thread: confirm_lang + handoff agent
KB #268 missing language: short TRANSLATE-KEY or handoff
Subject misunderstood: #879 CHATMIS not language alone
FR error only: #890 LANG not codeswitch
Essential codeswitch_bot KPIs
Five CODESWITCHbot monitoring metrics and correlation #891.
codeswitch_bot_follow_rate: % of responses in the customer's language
codeswitch_bot_mixlang_deflect: resolved without a mixlang_ ticket
codeswitch_bot_wrong_lang_rate: responses in a language other than the customer's
codeswitch_bot_switch_detect_rate: % of language changes detected
codeswitch_bot_confirm_accept_rate: % of confirm_lang accepted
Target: wrong_lang_rate close to 0 and mixlang_deflect on the rise.
CODESWITCHbot Anti-patterns
Five common code-switching errors.
Frozen session language: DETECT-PER-MESSAGE mandatory
Force shop language: NO-FORCE-SINGLE-LANG
FR response EN body: RESPOND-MATCH total consistency
Ignore feed #891: MIXLANG-FEED-LOOP wrong_lang
Systematic bilingual: BILINGUAL-FALLBACK only if uncertain
CODESWITCHbot with Qstomy
Qstomy on Shopify: language detection by message, MIXLANG-MAP feed #891, KB #268 multilingual, FOLLOW-CLIENT-LANG, KPI codeswitch_bot dashboard.
Scenario: retail EU, 40% EN turns after FR. FOLLOW + confirm switch. codeswitch_bot_mixlang_deflect +31%, wrong_lang -42% in 5 weeks.
Explore AI support and request a demo.
Checklist, FAQ and going further
CODESWITCHbot Checklist (8 steps)
Sync MIXLANG-MAP #891: feed code_switch bot_wrong_lang
Policy CODESWITCHBOT-SUP: 6 rules FOLLOW DETECT RESPOND-MATCH
8 intents bot_codeswitch_*: flow CSB-1 to CSB-8
4 templates TPL-CODESWITCHbot-*: CONFIRM FOLLOW BILINGUAL HYBRID
supported_langs FR EN: expand according to market
KB Link #268: customer service answers by language
Red team switch: FR turn 1 EN turn 3 follow test
KPI Dashboard: codeswitch_bot_* section 9 + delta mixlang_
FAQ
Difference #891?
#891 = agent tickets language mixing. #892 = bot follow widget switch.
Difference #16?
#892 = dynamic per message. #16 = global multilingual strategy.
Always confirm on switch?
Config switch_confirm_on_change. Direct follow if progressive switch.
Difference #890?
#890 = FR typos. #892 = language change FR EN.
Going further
This week: enable DETECT-PER-MESSAGE FR EN, test switch turn 3, sync bilingual KB #268, measure codeswitch_bot_mixlang_deflect.

Enzo
July 1, 2026





