Internationalization
Webnav.ai supports four languages with automatic detection.
Supported Languages
| Code | Language |
|---|---|
zh | Simplified Chinese |
en | English |
zht | Traditional Chinese |
ja | Japanese |
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:
data-langattribute — Highest priority; always respected if set- Page
langattribute — Reads<html lang="en">from the host page - Browser language — Uses
navigator.languageornavigator.userLanguage - 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.