Skip to content

Internationalization

Webnav.ai supports four languages with automatic detection.

Supported Languages

CodeLanguage
zhSimplified Chinese
enEnglish
zhtTraditional Chinese
jaJapanese

Setting the Language

Use the data-lang attribute to force a specific language:

html
<script src="https://widget.webnav.ai/widget/chat-widget.js" data-base-url="https://yoursite.com" data-lang="en"></script>

Auto-Detection Priority

When data-lang is omitted, the widget detects the language automatically using the following priority:

  1. data-lang attribute — Highest priority; always respected if set
  2. Page lang attribute — Reads <html lang="en"> from the host page
  3. Browser language — Uses navigator.language or navigator.userLanguage
  4. Fallback — Defaults to zh (Simplified Chinese)

Localized UI Elements

All widget UI strings are localized, including:

  • Chat bubble tooltip
  • Input placeholder text
  • Send button label
  • Loading and error messages
  • Sample question prompts

AI Response Language

The AI responds in the same language as the widget UI. If the visitor asks a question in a different language, the AI will typically respond in the visitor's language while keeping the UI in the configured language.

Webnav.ai — AI 智能客服