E-commerce

Multilingual AI chatbot: managing a conversation that switches from French to English

Multilingual AI chatbot: managing a conversation that switches from French to English

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

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.

  1. FOLLOW-CLIENT-LANG-BOT: follow active client language

  2. DETECT-PER-MESSAGE-BOT: detection on every message

  3. CONFIRM-ON-SWITCH-BOT: confirm notable language change

  4. RESPOND-MATCH-BOT: reply in the same language as client

  5. BILINGUAL-FALLBACK-BOT: short FR+EN if ambiguous

  6. 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.

  1. CSB-1 Ingest message: raw customer text

  2. CSB-2 Lang detect: bot_codeswitch_detect per message

  3. CSB-3 Switch check: language ≠ previous turn? confirm or follow

  4. CSB-4 Hybrid parse: if mixlang_hybrid extract intent

  5. CSB-5 Intent resolve: CS in active language KB #268

  6. CSB-6 Respond match: respond_match or bilingual_fallback

  7. CSB-7 Lock pref: lock_pref if customer confirms

  8. 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.

  1. Frozen session language: DETECT-PER-MESSAGE mandatory

  2. Force shop language: NO-FORCE-SINGLE-LANG

  3. FR response EN body: RESPOND-MATCH total consistency

  4. Ignore feed #891: MIXLANG-FEED-LOOP wrong_lang

  5. 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)

  1. Sync MIXLANG-MAP #891: feed code_switch bot_wrong_lang

  2. Policy CODESWITCHBOT-SUP: 6 rules FOLLOW DETECT RESPOND-MATCH

  3. 8 intents bot_codeswitch_*: flow CSB-1 to CSB-8

  4. 4 templates TPL-CODESWITCHbot-*: CONFIRM FOLLOW BILINGUAL HYBRID

  5. supported_langs FR EN: expand according to market

  6. KB Link #268: customer service answers by language

  7. Red team switch: FR turn 1 EN turn 3 follow test

  8. 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

Convert over 2,000 customers on average per month with Qstomy.

The world’s 1st Shopify AI dedicated to customer conversion

Empowering 200+ e-commerce merchants

Subscribe to the newsletter and get a personalized e-book!

No-code solution, no technical knowledge required. AI trained on your e-shop and non-intrusive.

*Unsubscribe at any time. We do not send spam.

Subscribe to the newsletter and get a personalized e-book!

No-code solution, no technical knowledge required. AI trained on your e-shop and non-intrusive.

*Unsubscribe at any time. We do not send spam.