Skip to content

Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.

feat: enhance localization support and improve theme handling in widget

nirholasd9f804007d71
diff --git a/.i18nrc.json b/.i18nrc.json
index 7cf2d57b0..64e9ddaca 100644
--- a/.i18nrc.json
+++ b/.i18nrc.json
@@ -3,7 +3,7 @@
"entry": "public/locales/en.json",
"entryLocale": "en",
"output": "public/locales",
- "outputLocales": ["es", "zh-CN", "ja", "ko", "fr", "de", "pt-BR", "ar", "hi", "ru"],
+ "outputLocales": ["es", "zh-CN", "ja", "ko", "fr", "de", "pt-BR", "ar", "hi", "ru", "tr", "vi", "id", "th", "fil", "zh-TW", "it", "pl", "nl", "uk", "fa"],
"localeNames": {
"en": "English",
"es": "Español",
@@ -15,7 +15,18 @@
"pt-BR": "Português (BR)",
"ar": "العربية",
"hi": "हिन्दी",
- "ru": "Русский"
+ "ru": "Русский",
+ "tr": "Türkçe",
+ "vi": "Tiếng Việt",
+ "id": "Bahasa Indonesia",
+ "th": "ไทย",
+ "fil": "Filipino",
+ "zh-TW": "繁體中文",
+ "it": "Italiano",
+ "pl": "Polski",
+ "nl": "Nederlands",
+ "uk": "Українська",
+ "fa": "فارسی"
},
"rtlLocales": ["ar", "he", "fa", "ur"],
"provider": "vertex",
diff --git a/concierge-sdk/src/widget.js b/concierge-sdk/src/widget.js
index 66242f579..6408bc1e7 100644
--- a/concierge-sdk/src/widget.js
+++ b/concierge-sdk/src/widget.js
@@ -270,20 +270,32 @@ export class Concierge {
this.$.mic.addEventListener('click', () => this._toggleMic());
}
- if (this.config.theme === 'auto' && window.matchMedia) {
- this._mq = window.matchMedia('(prefers-color-scheme: dark)');
- this._onScheme = () => this._applyTheme(root);
- this._mq.addEventListener?.('change', this._onScheme);
+ if (this.config.theme === 'auto') {
+ if (window.matchMedia) {
+ this._mq = window.matchMedia('(prefers-color-scheme: dark)');
+ this._onScheme = () => this._applyTheme(root);
+ this._mq.addEventListener?.('change', this._onScheme);
+ }
+ // Live-follow the host's theme toggle too (data-theme flips on <html>).
+ this._themeObs = new MutationObserver(() => this._applyTheme(root));
+ this._themeObs.observe(document.documentElement, {
+ attributes: true,
+ attributeFilter: ['data-theme'],
+ });
}
}
_applyTheme(root) {
- const theme =
- this.config.theme !== 'auto'
- ? this.config.theme
- : window.matchMedia?.('(prefers-color-scheme: dark)').matches
- ? 'dark'
- : 'light';
+ // Auto mode prefers the HOST's own theme signal when it publishes one
+ // (the common `data-theme="dark|light"` convention on <html>), because a
+ // site pinned dark must not get a light widget just because the OS is
+ // light. Falls back to prefers-color-scheme.
+ let theme = this.config.theme;
+ if (theme === 'auto') {
+ const host = document.documentElement.getAttribute('data-theme');
+ if (host === 'dark' || host === 'light') theme = host;
+ else theme = window.matchMedia?.('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
+ }
root.setAttribute('data-tc-theme', theme);
}
@@ -703,6 +715,7 @@ export class Concierge {
this._abort?.abort();
this._killTeaser();
this._mq?.removeEventListener?.('change', this._onScheme);
+ this._themeObs?.disconnect();
this._mic?.dispose();
this._narrator?.dispose();
this._stage?.dispose();
diff --git a/pages/concierge.html b/pages/concierge.html
index f1bb3a6aa..44db83ff8 100644
--- a/pages/concierge.html
+++ b/pages/concierge.html
@@ -122,7 +122,7 @@
transition: transform 0.15s ease, filter 0.15s ease, border-color 0.15s ease;
}
.cl-btn:hover { transform: translateY(-1px); }
- .cl-btn-primary { background: var(--accent); color: var(--accent-contrast, #fff); }
+ .cl-btn-primary { background: var(--btn-primary-bg, var(--accent)); color: var(--btn-primary-fg, #0a0a0a); }
.cl-btn-primary:hover { filter: brightness(1.08); }
.cl-btn-ghost { border: 1px solid var(--border-primary); color: var(--text-primary); }
.cl-btn-ghost:hover { border-color: var(--accent); }
diff --git a/src/walk-companion.js b/src/walk-companion.js
index ff23b1bb8..126b8fd9b 100644
--- a/src/walk-companion.js
+++ b/src/walk-companion.js
@@ -13,6 +13,7 @@
// lazy import() chunk and isn't pulled in until the avatar detaches.
import { createWalkCompanion } from '../walk-sdk/src/companion.js';
+import { DEFAULT_EXCLUDED_PREFIXES } from '../walk-sdk/src/config.js';
import { installTransitions } from './walk-companion-transitions.js';
import { createWalkTrails2D, createTrailSetting, TRAIL_STYLE_LABELS } from './walk-trails.js';
import { installClickToWalk } from './walk-companion-click-to-walk.js';
@@ -30,6 +31,10 @@ const walk = createWalkCompanion({
manifestUrl: '/animations/manifest.json',
// "Make your own" link in the avatar picker → the avatar builder.
docsUrl: '/avatar-studio',
+ // /concierge mounts its own corner widget (the live Concierge demo); two
+ // companions fighting over the same corner reads as broken, so the walk
+ // mascot sits that page out.
+ excludedRoutes: [...DEFAULT_EXCLUDED_PREFIXES, '/concierge'],
});
// public/nav.js drives the companion through this global (toggle from the nav