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(home): route the live house and the voice panel through the translation pipeline

nirholas44007d16c495
diff --git a/package.json b/package.json
index 16a37b985..7f79956be 100644
--- a/package.json
+++ b/package.json
@@ -185,6 +185,7 @@
"i18n:annotate": "node scripts/i18n-annotate.mjs",
"i18n:extract": "node scripts/i18n-extract.mjs",
"i18n:translate": "node scripts/i18n-translate.mjs",
+ "i18n:home": "node scripts/i18n-home-keys.mjs",
"i18n:lint": "node scripts/i18n-translate.mjs --lint",
"i18n:prune": "node scripts/i18n-translate.mjs --prune",
"i18n:repair": "node scripts/i18n-translate.mjs --repair",
@@ -228,7 +229,7 @@
"audit:route-shadowing": "node scripts/audit-route-shadowing.mjs",
"audit:handlers": "node scripts/audit-empty-handlers.mjs",
"audit:x402-catalog": "node scripts/audit-x402-catalog.mjs",
- "gate": "npm run check:conflicts && npm run check:claude && npm run check:vendored && npm run check:model-viewer && npm run check:gcloudignore && npm run check:fetch-timeouts && npm run check:tdz-bootstrap && npm run check:event && npm run check:cron-syntax && npm run check:studio-openapi && npm run test:gate && npm run test:gate-3d && npm run audit:mcp && npm run audit:mcp-golden && npm run audit:mcp-safety && npm run audit:mcp-catalog && npm run audit:mcp-listing && npm run audit:routes && npm run audit:handlers && npm run audit:pages && npm run audit:links && npm run check:awesome && npm run audit:docs && npm run audit:upstreams && npm run check:tutorials && npm run audit:hidden-guard && npm run audit:inline-handlers && npm run audit:x402-catalog && npm run audit:tokens && npm run audit:states && npm run audit:motion-tokens && npm run audit:guards && npm run audit:tour-atlas && npm run check:ios-icons && npm run check:macos-icon && npm run check:apple-widget && npm run check:windows-widget && npm run check:announce && npm run check:skills-seed && npm run audit:motion && npm run audit:tour-global && npm run check:doc-media && npm run check:images && npm run audit:route-shadowing",
+ "gate": "npm run check:conflicts && npm run check:claude && npm run check:vendored && npm run check:model-viewer && npm run check:gcloudignore && npm run check:fetch-timeouts && npm run check:tdz-bootstrap && npm run check:event && npm run check:cron-syntax && npm run check:studio-openapi && npm run test:gate && npm run test:gate-3d && npm run audit:mcp && npm run audit:mcp-golden && npm run audit:mcp-safety && npm run audit:mcp-catalog && npm run audit:mcp-listing && npm run audit:routes && npm run audit:handlers && npm run audit:pages && npm run audit:links && npm run check:awesome && npm run audit:docs && npm run audit:upstreams && npm run check:tutorials && npm run audit:hidden-guard && npm run audit:inline-handlers && npm run audit:x402-catalog && npm run audit:tokens && npm run audit:states && npm run audit:motion-tokens && npm run audit:guards && npm run audit:tour-atlas && npm run check:ios-icons && npm run check:macos-icon && npm run check:apple-widget && npm run check:windows-widget && npm run check:announce && npm run i18n:home && npm run check:skills-seed && npm run audit:motion && npm run audit:tour-global && npm run check:doc-media && npm run check:images && npm run audit:route-shadowing",
"test:gate-3d": "vitest run tests/glb-canonicalize.test.js tests/animation-retarget.test.js tests/animation-retarget-rest-pollution.test.js tests/viewer-framing.test.js",
"audit:mcp-golden": "node scripts/audit-mcp-golden.mjs",
"audit:mcp-safety": "node scripts/audit-mcp-safety.mjs",
diff --git a/pages/home-scene.html b/pages/home-scene.html
index ef4a2e75d..7ac22fbbf 100644
--- a/pages/home-scene.html
+++ b/pages/home-scene.html
@@ -8,6 +8,12 @@
<meta name="description" content="A live 3D model of your house driven by Home Assistant: every room lit the way the real room is lit, every door and lock shown as it really is, and your agent standing in it." data-i18n-attr="content:home_scene.meta_description" />
<meta name="robots" content="noindex, follow" />
<link rel="icon" href="/favicon.ico" sizes="any" />
+ <!-- The platform PWA manifest, scope "/". A connected home is the one surface
+ here meant to live on a screen that stays put (a kitchen tablet on a
+ shelf), and an installed window is what makes that a display rather than
+ a browser tab. No lane-specific manifest is invented for it. -->
+ <link rel="manifest" href="/manifest.webmanifest" />
+ <link rel="apple-touch-icon" href="/apple-touch-icon.png" />
<link rel="stylesheet" href="/style.css" />
<link rel="stylesheet" href="/nav.css" />
<link rel="stylesheet" href="/fonts/fonts.css" />
diff --git a/pages/smart-home-join.html b/pages/smart-home-join.html
index 775c53a75..d6c2e1d00 100644
--- a/pages/smart-home-join.html
+++ b/pages/smart-home-join.html
@@ -17,6 +17,12 @@
<meta name="twitter:title" content="Join a home · three.ws" data-i18n-attr="content:home_join.meta_twitter_title" />
<meta name="twitter:description" content="An invitation to a household: which home, what you would be able to do there, and what you would never be able to do." data-i18n-attr="content:home_join.meta_twitter_description" />
<link rel="icon" href="/favicon.ico" sizes="any" />
+ <!-- The platform PWA manifest, scope "/". A connected home is the one surface
+ here meant to live on a screen that stays put (a kitchen tablet on a
+ shelf), and an installed window is what makes that a display rather than
+ a browser tab. No lane-specific manifest is invented for it. -->
+ <link rel="manifest" href="/manifest.webmanifest" />
+ <link rel="apple-touch-icon" href="/apple-touch-icon.png" />
<link rel="stylesheet" href="/style.css" />
<link rel="stylesheet" href="/nav.css" />
<link rel="stylesheet" href="/fonts/fonts.css" />
diff --git a/pages/smart-home-plan.html b/pages/smart-home-plan.html
index 23cb73d5c..338635da7 100644
--- a/pages/smart-home-plan.html
+++ b/pages/smart-home-plan.html
@@ -16,6 +16,12 @@
<meta name="twitter:title" content="Home plan · three.ws" data-i18n-attr="content:home_plan.meta_twitter_title" />
<meta name="twitter:description" content="What your plan covers for connected homes, what you have used, and when it resets. Safety actions are never limited." data-i18n-attr="content:home_plan.meta_twitter_description" />
<link rel="icon" href="/favicon.ico" sizes="any" />
+ <!-- The platform PWA manifest, scope "/". A connected home is the one surface
+ here meant to live on a screen that stays put (a kitchen tablet on a
+ shelf), and an installed window is what makes that a display rather than
+ a browser tab. No lane-specific manifest is invented for it. -->
+ <link rel="manifest" href="/manifest.webmanifest" />
+ <link rel="apple-touch-icon" href="/apple-touch-icon.png" />
<link rel="stylesheet" href="/style.css" />
<link rel="stylesheet" href="/nav.css" />
<link rel="stylesheet" href="/fonts/fonts.css" />
diff --git a/pages/smart-home-privacy.html b/pages/smart-home-privacy.html
index 2045c25c6..5f46d97f8 100644
--- a/pages/smart-home-privacy.html
+++ b/pages/smart-home-privacy.html
@@ -16,6 +16,12 @@
<meta name="twitter:title" content="Your home data · three.ws" />
<meta name="twitter:description" content="Everything we store about your connected homes, and the controls to export or delete all of it." />
<link rel="icon" href="/favicon.ico" sizes="any" />
+ <!-- The platform PWA manifest, scope "/". A connected home is the one surface
+ here meant to live on a screen that stays put (a kitchen tablet on a
+ shelf), and an installed window is what makes that a display rather than
+ a browser tab. No lane-specific manifest is invented for it. -->
+ <link rel="manifest" href="/manifest.webmanifest" />
+ <link rel="apple-touch-icon" href="/apple-touch-icon.png" />
<link rel="stylesheet" href="/style.css" />
<link rel="stylesheet" href="/nav.css" />
<link rel="stylesheet" href="/fonts/fonts.css" />
diff --git a/pages/smart-home-satellite.html b/pages/smart-home-satellite.html
index 47135f9b8..467bcf59a 100644
--- a/pages/smart-home-satellite.html
+++ b/pages/smart-home-satellite.html
@@ -16,6 +16,12 @@
<meta name="twitter:title" content="Voice satellite · three.ws" data-i18n-attr="content:home_satellite.meta_twitter_title" />
<meta name="twitter:description" content="Your Home Assistant voice assistant is a speaker with an LED ring. Give it a face, lip sync and a body that turns toward you." data-i18n-attr="content:home_satellite.meta_twitter_description" />
<link rel="icon" href="/favicon.ico" sizes="any" />
+ <!-- The platform PWA manifest, scope "/". A connected home is the one surface
+ here meant to live on a screen that stays put (a kitchen tablet on a
+ shelf), and an installed window is what makes that a display rather than
+ a browser tab. No lane-specific manifest is invented for it. -->
+ <link rel="manifest" href="/manifest.webmanifest" />
+ <link rel="apple-touch-icon" href="/apple-touch-icon.png" />
<link rel="stylesheet" href="/style.css" />
<link rel="stylesheet" href="/nav.css" />
<link rel="stylesheet" href="/fonts/fonts.css" />
diff --git a/pages/smart-home.html b/pages/smart-home.html
index 31867aab3..805985d30 100644
--- a/pages/smart-home.html
+++ b/pages/smart-home.html
@@ -16,6 +16,12 @@
<meta name="twitter:title" content="Smart home · three.ws" data-i18n-attr="content:smart_home.meta_twitter_title" />
<meta name="twitter:description" content="Connect a Home Assistant house to your three.ws agent. Reads are free; anything that opens the house stops and asks." data-i18n-attr="content:smart_home.meta_twitter_description" />
<link rel="icon" href="/favicon.ico" sizes="any" />
+ <!-- The platform PWA manifest, scope "/". A connected home is the one surface
+ here meant to live on a screen that stays put (a kitchen tablet on a
+ shelf), and an installed window is what makes that a display rather than
+ a browser tab. No lane-specific manifest is invented for it. -->
+ <link rel="manifest" href="/manifest.webmanifest" />
+ <link rel="apple-touch-icon" href="/apple-touch-icon.png" />
<link rel="stylesheet" href="/style.css" />
<link rel="stylesheet" href="/nav.css" />
<link rel="stylesheet" href="/fonts/fonts.css" />
diff --git a/public/home-scene.css b/public/home-scene.css
index 0b27c8f56..27872f60d 100644
--- a/public/home-scene.css
+++ b/public/home-scene.css
@@ -543,3 +543,39 @@
.hs-panel { max-height: none; }
.hs-title { max-width: 14ch; }
}
+
+/*
+ * Reduced motion, across the whole page and not just the three animations that
+ * used to name themselves here.
+ *
+ * The 3D scene already honours the preference from the inside: every damped
+ * quantity in src/home/scene-render.js snaps to its target, OrbitControls stops
+ * coasting, and focusing a room places the camera rather than flying it. What
+ * was left was the chrome around it, where a house's state travels in CSS: a
+ * room's light dot cross-fading to its new colour, a card fading as it goes
+ * stale, the whole canvas desaturating over --duration-slow. Those are the
+ * scene's transitions too, and someone who asked for less motion asked for
+ * these as well.
+ *
+ * The rule is a snap, never a freeze. A house is a live readout: values keep
+ * arriving and keep being correct, they simply stop travelling to their new
+ * state. 1ms rather than 0 so a transitionend listener still fires.
+ */
+@media (prefers-reduced-motion: reduce) {
+ .hs-shell *,
+ .hs-shell *::before,
+ .hs-shell *::after {
+ animation-duration: 1ms !important;
+ animation-iteration-count: 1 !important;
+ animation-delay: 0s !important;
+ transition-duration: 1ms !important;
+ transition-delay: 0s !important;
+ scroll-behavior: auto !important;
+ }
+ /* The 2D house's cards are the one place a transform moves a whole block
+ rather than a colour. */
+ .hs-card,
+ .hs-btn:active:not(:disabled) {
+ transform: none !important;
+ }
+}
diff --git a/public/locales/en.json b/public/locales/en.json
index 9d99703bb..f3f2a937e 100644
--- a/public/locales/en.json
+++ b/public/locales/en.json
@@ -1947,6 +1947,7 @@
},
"avatar_studio": {
"base": "Base",
+ "drop_into_play_as_this_avatar_title": "Drop into /play as this avatar",
"loading_avatar": "Loading avatar…",
"meta_description": "Build a custom 3D avatar from scratch. Choose body type, sculpt face and body, add outfits and accessories. No selfie required.",
"meta_og_description": "Build a custom 3D avatar from scratch. Choose body type, sculpt face and body, add outfits and accessories.",
@@ -1955,6 +1956,7 @@
"meta_twitter_description": "Build a custom 3D avatar from scratch. Choose body type, sculpt face and body, add outfits and accessories. No selfie required.",
"meta_twitter_title": "Avatar Studio · three.ws",
"parametric_sliders_count": "Parametric <span class=\"as-base-new\">300+ sliders</span>",
+ "play_as_this": "▶ Play as this",
"randomise_look_title": "Randomise look",
"redo_arialabel": "Redo",
"redo_ctrl_shift_z_title": "Redo (Ctrl+Shift+Z)",
@@ -3258,6 +3260,7 @@
"meta_twitter_description": "Start here: build an AI agent, make a 3D avatar, generate a 3D model, or launch a token world — one hub, four paths.",
"meta_twitter_title": "Create · three.ws",
"need_a_model_to_upload_build_one": "Need a model to upload? Build one in <a href=\"/studio\">three.ws Studio</a>. Bringing an avatar from another platform? <a href=\"/import/rpm\">import it here</a>.",
+ "need_a_model_to_upload_build_one_v2": "Need a model to upload? Build one in <a href=\"/avatar-studio\">Avatar Studio</a> or generate one in <a href=\"/forge\">Forge</a>. Bringing an avatar from another platform? <a href=\"/import/rpm\">import it here</a>.",
"no_sign_in": "No sign-in",
"no_sign_in_2": "No sign-in",
"no_sign_in_3": "No sign-in",
@@ -3313,6 +3316,7 @@
"every_agent_gets_a_3d_avatar_pick": "Every agent gets a 3D avatar. Pick a ready-made character, upload your own glTF model, or <a href=\"/create/prompt\">describe one in words and generate it</a> — you can always swap it later.",
"every_agent_ships_with_a_core_set": "Every agent ships with a core set. Toggle on extra capabilities to extend what yours can do.",
"every_agent_speaks_pick_the_built_in": "Every agent speaks. Pick the built-in voice, or record a short sample and your agent talks in your own cloned voice everywhere on three.ws.",
+ "find_it_again": "Need it later? It is always waiting under <a href=\"/mine\">My creations</a> in the menu.",
"five_quick_steps_name_it_give_it": "Five quick steps — name it, give it a body, pick its skills, set its voice, ship it.",
"free_browser_text_to_speech_works_instantly": "Free browser text-to-speech. Works instantly, no setup.",
"fund_agent_wallet": "Fund agent wallet",
@@ -4368,6 +4372,8 @@
"meta_title": "DeFi TVL & Protocols · three.ws",
"meta_twitter_description": "Live DeFi total value locked — the top protocols ranked by TVL, with category, chains, and 1d/7d moves.",
"meta_twitter_title": "DeFi TVL & Protocols · three.ws",
+ "refresh": "Refresh",
+ "refresh_aria": "Refresh the DeFi TVL figures",
"top_protocols_by_tvl": "Top Protocols by TVL",
"total_value_locked_across_decentralized_fina": "Total value locked across decentralized finance — the top protocols ranked by TVL, with category, the chains they run on, and how each moved over the last day and week."
},
@@ -4515,6 +4521,7 @@
"agent_economy": "Agent Economy",
"agents": "Agents",
"amount": "Amount",
+ "demo_could_not_run": "Demo could not run",
"details": "Details",
"launches": "Launches",
"meta_description": "Watch NOVA and ORACLE — two three.ws AI agents with real Solana wallets — discover services on the x402 bazaar, pay each other in SOL, and display a live market briefing on the TV in their world.",
@@ -4529,7 +4536,11 @@
"oracle_provider": "<span class=\"dot\"></span>ORACLE · provider",
"ready_click_run_demo": "Ready — click Run demo",
"real_solana_infrastructure_x402_protocol": "Real Solana infrastructure · x402 protocol",
+ "retry": "Retry",
"run_demo": "<span id=\"run-label\">Run demo</span>",
+ "scene_arialabel": "3D scene: the agents NOVA and ORACLE either side of a screen that shows the x402 bazaar, the payment, and the delivered market briefing",
+ "scene_unavailable": "3D scene unavailable",
+ "scene_unavailable_body": "This browser could not start WebGL, so the world is not rendering. The demo still runs: press Run demo and follow the payment and the market briefing in the panel beside it.",
"show_payment_details_arialabel": "Show payment details",
"signature": "Signature",
"simulated": "<span class=\"sim-tag\">Simulated</span>",
@@ -7832,6 +7843,7 @@
"embed_this_model_on_any_webs_title": "Embed this model on any website",
"engine": "Engine",
"enter_a_prompt_to_generate": "Enter a prompt to generate",
+ "everything_you_made": "Everything you made →",
"feel_free_to_leave_this_page_your": "Feel free to leave this page. Your model keeps generating, lands in your gallery automatically, and signed-in creators get notified when it's ready.",
"fill_the_box_with_a_random_v_arialabel": "Fill the box with a random vivid prompt",
"finalizing_glb": "Finalizing GLB",
@@ -9186,19 +9198,175 @@
"title": "Your voice assistant already works. Give it a face."
},
"home_scene": {
+ "act_aria": "{{action}} {{name}} in {{room}}",
+ "act_arm": "Arm",
+ "act_close": "Close",
+ "act_disarm": "Disarm",
+ "act_done": "{{name}}: {{action}}.",
+ "act_failed": "That did not work.",
+ "act_lock": "Lock",
+ "act_open": "Open",
+ "act_pause": "Pause",
+ "act_play": "Play",
+ "act_send_home": "Send home",
+ "act_start": "Start",
+ "act_turn_off": "Turn off",
+ "act_turn_on": "Turn on",
+ "act_unlock": "Unlock",
+ "action_failed": "Action failed",
+ "attr_brightness": "Brightness",
+ "attr_class": "Class",
+ "attr_colour": "Colour",
+ "attr_now": "Now",
+ "attr_open": "Open",
+ "attr_playing": "Playing",
+ "attr_set_to": "Set to",
"back": "Homes",
+ "cancelled": "Cancelled. Nothing moved.",
+ "confirm_aria": "Confirm this action",
+ "confirm_no": "Cancel",
+ "confirm_question": "{{action}} {{name}}?",
+ "confirm_remember": "Do not ask again for {{name}}",
+ "confirm_spoken": "{{risk}}. {{question}} {{why}} Answer with the Yes or Cancel button, or press Escape to cancel.",
+ "confirm_yes": "Yes, do it",
+ "connection_settings": "Connection settings",
+ "currently": "Currently {{state}}.",
+ "desc_devices": {
+ "one": "{{count}} device.",
+ "other": "{{count}} devices."
+ },
+ "desc_lights_on": "{{on}} of {{total}} lights on.",
+ "desc_no_lights": "No lights on out of {{total}}.",
+ "desc_open": "{{count}} open or unlocked.",
+ "desc_secure": "Everything here is closed and locked.",
+ "device_unreachable": "Home Assistant cannot reach this device right now.",
+ "dropped": "The connection to your home dropped. The house below is the last state we saw.",
+ "empty_action": "Add a device in Home Assistant",
+ "empty_body": "Home Assistant answered, but it is not exposing any devices yet. Add an integration in Home Assistant (Settings, Devices and services), and this scene fills in as soon as the first device appears. Nothing else to do here.",
+ "empty_title": "Your home is connected, and empty",
+ "err_auth_body": "A home belongs to the account that connected it. Sign in and this page opens straight onto your house.",
+ "err_auth_title": "Sign in to see this home",
+ "err_generic_body": "The request failed. Trying again usually works; if it keeps failing, the connection settings will say why.",
+ "err_generic_title": "Something went wrong loading your home",
+ "err_missing_body": "Either this home was removed, or it belongs to another account. Your connected homes are one click away.",
+ "err_missing_title": "That home is not here",
+ "err_pending_body": "The link to your house is coming up, or was paused after repeated failures. Give it a moment and try again.",
+ "err_pending_title": "Still opening the connection",
+ "err_token_action": "Reconnect this home",
+ "err_token_body": "The long-lived access token this home was connected with no longer works. Create a new one in Home Assistant (your profile, Security) and reconnect.",
+ "err_token_title": "Home Assistant rejected the token",
+ "err_unreachable_body": "three.ws could not reach this Home Assistant. If it only exists on your home network, a public server cannot route to it: use your remote https URL, or run the three.ws add-on inside the network.",
+ "err_unreachable_title": "Your home did not answer",
+ "flat_from_sensors": {
+ "one": "{{label}} from {{count}} sensor",
+ "other": "{{label}} from {{count}} sensors"
+ },
+ "flat_hidden": {
+ "one": "{{count}} more device in this room",
+ "other": "{{count}} more devices in this room"
+ },
+ "flat_lights_on": "{{on}} of {{total}} lights on",
+ "flat_no_lights": "no lights",
+ "flat_open_count": "{{count}} open",
+ "flat_secure": "secure",
+ "fps_kept": "This device is holding {{fps}} frames a second in the 3D house. The 2D button is faster if it feels heavy.",
+ "fps_switched": "This device held only {{fps}} frames a second, so your home switched to the 2D view. The 3D button turns it back on.",
+ "is_open": {
+ "one": "{{names}} is open.",
+ "other": "{{names}} are open."
+ },
+ "is_unlocked": {
+ "one": "{{names}} is unlocked.",
+ "other": "{{names}} are unlocked."
+ },
+ "last_seen": "Last seen {{ago}}. Showing the house as it was.",
"loading_title": "Loading your home",
+ "log_entry": "{{action}} {{name}}",
+ "log_needs_yes": "{{entry}} (needs your yes)",
"meta_description": "A live 3D model of your house driven by Home Assistant: every room lit the way the real room is lit, every door and lock shown as it really is, and your agent standing in it.",
+ "meta_lights": "{{on}}/{{total}}",
+ "meta_open": "open",
"meta_title": "Your home, live · three.ws",
+ "n_more": "{{count}} more",
+ "no_id_body": "A home scene needs a home id, as in /home/<id>. Open one from your list of connected homes.",
+ "no_id_title": "No home in that link",
+ "no_rooms": "No rooms yet.",
+ "no_webgl_stays": "WebGL is unavailable in this browser, so the 2D house stays on.",
+ "no_webgl_switched": "This browser cannot run WebGL, so your home is shown as a floor list you can still read and control.",
+ "no_webgl_title": "This browser cannot run WebGL.",
+ "overlay_dismiss": "Show me the house anyway",
"panel_aria": "Selected device",
"panel_empty": "Pick a room on the left, or click anything in the house to see what it is and act on it.",
"rail_aria": "Rooms",
"rail_head": "Rooms",
"reconnect": "Reconnect",
+ "render_failed": "The 3D house could not start, so the 2D house is on instead.",
+ "risk_physical": "Moves something physical",
+ "risk_security": "Opens your home",
+ "said_device": "{{name}}. {{state}} Its controls are in the device panel.",
+ "said_room": "{{name}}. {{description}}",
+ "sign_in": "Sign in",
+ "something_open": "Something in this room is open.",
+ "state_closed": "closed",
+ "state_on_at": "on · {{percent}}",
+ "state_open": "open",
+ "state_part_open": "{{percent}} open",
"status_connecting": "Connecting",
+ "status_disconnected": "Disconnected",
+ "status_live": "Live",
+ "status_reauth": "Sign in again",
+ "status_reconnecting": "Reconnecting",
+ "status_stale": "Stale",
+ "this_device": "this device",
+ "try_again": "Try again",
+ "unfiled_action": "Assign rooms in Home Assistant",
+ "unfiled_body": "Every device in this house is unfiled, so they are all in one room below. Assign them to areas in Home Assistant (Settings, Areas and zones) or lay the house out here, and the scene splits into real rooms.",
+ "unfiled_title": "Nothing is in a room yet",
+ "unreachable": "unreachable",
+ "unreachable_sentence": "Unreachable.",
+ "untitled_home": "Your home",
"view_2d_aria": "Show the house as a room and device list",
"view_3d_aria": "Show the 3D house",
- "view_plan_aria": "Draw where the rooms are"
+ "view_plan_aria": "Draw where the rooms are",
+ "working": "Working",
+ "your_homes": "Your homes"
+ },
+ "home_voice": {
+ "act_cancel": "Cancel",
+ "act_confirm": "Confirm",
+ "act_consent": "Turn on hands-free",
+ "act_mute": "Mute",
+ "act_not_now": "Not now",
+ "act_off": "Turn hands-free off",
+ "act_retry": "Try again",
+ "act_unmute": "Unmute",
+ "budget": "Budget {{budget}} ms, worst {{worst}} ms over {{count}}",
+ "confirm_hint": "Say <strong>confirm</strong> to continue. A general yes does not count.",
+ "consent_heading": "Before you turn this on",
+ "latency_aria": "Measured latency",
+ "leg_action": "Action to device",
+ "leg_asr": "Transcription",
+ "leg_endpoint": "End of speech",
+ "leg_first_audio": "First audible reply",
+ "leg_tool_call": "First tool call",
+ "leg_tts": "Speech synthesis",
+ "leg_turn": "Agent turn",
+ "line_barge_in": "You interrupted, so it stopped talking.",
+ "line_cancelled": "Cancelled. Nothing changed.",
+ "line_confirmed": "Confirmed and carried out.",
+ "line_expired": "The confirmation expired. Nothing changed.",
+ "line_guarded_refused": "Refused: a guarded action cannot be confirmed by voice on a screenless device.",
+ "line_not_token": "That was not the word confirm, so nothing was unlocked.",
+ "line_woke": "Woke on \"{{phrase}}\" ({{score}}).",
+ "mic_live_local": "Microphone live, matching the wake word on this device",
+ "mic_live_sending": "Microphone live, and this is being sent for transcription",
+ "mic_off": "Microphone off",
+ "mic_stopped": "Microphone stopped",
+ "ms": "{{n}} ms",
+ "off_badge": "Off",
+ "off_title": "Hands-free is off",
+ "transcript_aria": "Conversation",
+ "wake_word": "Wake word"
},
"hydrate_index": {
"connect_wallet": "Connect Wallet",
@@ -9774,6 +9942,7 @@
"save_position": "Save position",
"scam_or_off_brand_coin": "Scam or off-brand coin",
"send": "Send",
+ "send_2": "Send",
"sexual_content": "Sexual content",
"share": "Share",
"share_arialabel": "Share",
@@ -9783,11 +9952,13 @@
"spam_or_advertising": "Spam or advertising",
"sweep_your_phone_slowly_to_find_the": "Sweep your phone slowly to find the floor",
"switch_ai_agent_arialabel": "Switch AI agent",
+ "talk": "Talk",
"tell_us_what_s_wrong_reports_are": "Tell us what’s wrong. Reports are reviewed; a pin is hidden once enough people flag it.",
"this_room_was_placed_without_a_compass": "This room was placed without a compass, so it may appear rotated. Face the room’s front and tap Align to match it to your view.",
"three_ws_irl_augmented_reali_arialabel": "three.ws IRL — augmented reality",
"try_again": "Try again",
"turn_on_camera_ar_then_tap_pin": "Turn on Camera AR, then tap Pin here to anchor your agent in real space.",
+ "view_in_ar": "View in AR",
"view_profile": "View profile",
"visible_to_all_users_at_this_location": "Visible to all users at this location",
"w": "W",
@@ -11670,6 +11841,7 @@
"meta_title": "My Agents · three.ws",
"my_agents": "My Agents",
"my_agents_2": "My Agents",
+ "see_everything": "Avatars and forged 3D models too? <a href=\"/mine\">My creations</a> has all of it in one grid.",
"your_3d_ai_agents_edit_chat_and": "Your 3D AI agents. Edit, chat, and manage them from here."
},
"nav": {
@@ -11870,6 +12042,7 @@
"efa7il": "Coins",
"emvzyi": "Build a white-label hosted launchpad page in minutes",
"euafmu": "Hacks Database",
+ "everything_you_have_made_title": "Everything you have made",
"f2bdok": "Live headlines from 37 publisher feeds with a rich reader for every story",
"fhbsli": "Launch",
"fjn1oc": "MCP Tool Catalog",
@@ -11904,6 +12077,8 @@
"mh63b0": "Fear & Greed",
"mhxakq": "Screener",
"mmfo8f": "All Launches",
+ "my_creations": "My creations",
+ "my_creations_arialabel": "My creations",
"n8aq0y": "Hidden gems — experimental, advanced surfaces most people never find",
"nbhxp1": "Free CC0 3D props, ready to use",
"nbw7wg": "Ops-room board for the whole fleet: live activity, money pulse, agent hires & platform health on one screen",
@@ -15580,11 +15755,13 @@
"how_what_metadata": "HOW, WHAT, metadata",
"if_the_conviction_cache_is_empty_fresh": "If the conviction cache is empty (fresh deploy), the feed endpoint scores a handful of recent coins on the spot — database-only, no LLM — so the UI is never blank while the score loop catches up. Every brain query is wrapped so a missing table yields a null slice, not a crashed pass.",
"ingest_tweets_to_additively_boost_a_coin": "Ingest tweets to additively boost a coin's virality (never downgrades an LLM read).",
+ "interactions_over_the_fitted_buckets": "Interactions over the fitted buckets",
"is_real_buying_pressure_actually_showing_up": "— is real buying pressure actually showing up?",
"it_is_a_probability_not_a_prophecy": "It is a probability, not a prophecy",
"key_columns_oracle_reads": "Key columns Oracle reads",
"label_smart_money_score_win_rate_early": "label, smart_money_score, win_rate, early_win_rate, dump_rate, coins_traded, creator_count, creator_wins",
"lean": "Lean",
+ "learned_weights_and_a_calibrated_probability": "Learned weights and a calibrated probability shipped in v2; the six-hourly refit behind a promotion gate shipped in v3. The next lever is the additive assumption itself: interaction terms or shallow trees over the same buckets, since the strongest observed patterns (holder concentration crossed with buyer count) are plausibly interactive and a sum of one-hot weights cannot express them.",
"learned_weights_logistic_calibration": "Learned weights & logistic calibration",
"let_a_launch_be_a_feature_vector": "Let a launch be a feature vector <code class=\"t\">x</code>. Oracle computes four pillar functions <code class=\"t\">f_k(x) ∈ [0,100]</code> for <code class=\"t\">k ∈ {ped, str, nar, mom}</code>, a weighted score, and a capped, clamped output:",
"lifecycle_a_coin_must_be_actually_first": "Lifecycle: a coin must be ≥… actually first-seen and within a 12h window to enter scoring; it's scored, classified, and cached; rescored when stale (every ~3 min if new data arrives); its history appended on material change; quote/stablecoin mints (USDC, wSOL, …) are excluded and purged. Nothing about a score decays purely with time — the engine is event-driven, reacting to new wallet activity, not a clock.",
@@ -15968,11 +16145,11 @@
"api_mcp": "/api/mcp",
"base_usdc": "Base USDC",
"bnb_chain_usdc": "⛓ BNB Chain <span class=\"chip\">USDC</span>",
+ "cancel": "cancel",
"connect_metamask": "Connect MetaMask",
"contract": "contract <a target=\"_blank\" rel=\"noopener\" href=\"https://bscscan.com/address/0x00000000381f09742a30a5a49975514AeC1B72Cc\"><code>0x00000000…1B72Cc</code></a>",
"every_action_on_this_page_costs_the": "Every action on this page costs the agent $0.001 USDC. Settled per call. No keys, no signup.",
"generate_wallet_instantly": "<span id=\"genSpinner\" style=\"display:none\" class=\"spinner\">↻</span> ⚡ Generate wallet instantly",
- "cancel": "cancel",
"got_it_let_s_go": "Got it, let's go",
"grind_a_vanity_address_instead": "🎨 Grind a vanity address instead",
"how_this_works": "How this works",
@@ -16143,6 +16320,7 @@
"active_has_data": "<i class=\"pl-dot is-active\" style=\"position:static\"></i> Active — has data",
"degraded_up_but_stalled": "<i class=\"pl-dot is-degraded\" style=\"position:static\"></i> Degraded — up but stalled",
"devnet": "devnet",
+ "every_number_on_this_board_comes": "Every number on this board comes from one public endpoint: <a id=\"pl-raw-api\" href=\"/api/pipeline?network=mainnet\" target=\"_blank\" rel=\"noopener\">/api/pipeline</a>, which returns the same stages plus a machine-readable next action. The recorder's own liveness detail lives at <a href=\"/api/sniper/status\" target=\"_blank\" rel=\"noopener\">/api/sniper/status</a>.",
"idle_awaiting_upstream": "<i class=\"pl-dot is-idle\" style=\"position:static\"></i> Idle — awaiting upstream",
"live_flowing_now": "<i class=\"pl-dot is-live\" style=\"position:static\"></i> Live — flowing now",
"mainnet": "mainnet",
@@ -16283,6 +16461,8 @@
"published_packages_mean_developers_adopt_us": "Published packages mean developers adopt us inside their own products — and stay.",
"real_time_3d_runs_in_every_browser": "Real-time 3D runs in every browser",
"rendered_client_side_no_video_stream_no": "<span class=\"ck\">✓</span> <span>Rendered client-side — no video stream, no server round-trip</span>",
+ "retry_the_live_render": "Retry the live render",
+ "retry_the_live_render_2": "Retry the live render",
"rigged_and_animated_ready_for_lip_sync": "<span class=\"ck\">✓</span> <span>Rigged and animated, ready for lip-sync and gesture</span>",
"rivals_ship_a_piece_we_ship_create": "Rivals ship a piece; we ship create-think-move-embed as one path no one else has end to end.",
"runs_on_every_modern_device_no_install": "runs on every modern device, no install",
@@ -16294,6 +16474,8 @@
"selfie_photo_sculpt_or_text_prompt_a": "Selfie, photo, sculpt, or text prompt → a rigged, animation-ready 3D character.",
"selfie_talking_embedded_agent_works_now": "selfie → talking, embedded agent works now",
"ship_anywhere": "Ship anywhere",
+ "stage_fallback_note": "<strong>The live 3D runtime did not load.</strong> This still frame is the same character, rendered from the same glTF file.",
+ "stage_fallback_note_2": "<strong>The live 3D runtime did not load.</strong> This still frame is the same character, rendered from the same glTF file.",
"standards_based": "Standards-based",
"stream_characters": "Stream characters",
"streamers_brands_and_support_teams_all_want": "Streamers, brands, and support teams all want a recognizable character that's always on.",
@@ -16452,6 +16634,7 @@
"meta_twitter_description": "A 3D avatar pays for a live API with its agent wallet. Real USDC on Solana, on-chain.",
"meta_twitter_title": "Agent Wallet — your avatar pays for an endpoint on Solana",
"mode": "Mode",
+ "page_heading": "Agent Wallet: your 3D avatar pays a live x402 endpoint with real USDC, settled on Solana",
"paid_endpoint_x402_on_solana": "Paid endpoint · x402 on Solana",
"payment_flow": "Payment flow",
"play": "play",
@@ -17171,6 +17354,7 @@
"all": "All",
"all_launches": "All launches →",
"caps_in_sol_loading_usd_price": "<span class=\"ph-dot\" aria-hidden=\"true\"></span> <span>Caps in SOL — loading USD price…</span>",
+ "filter_to_prime_coins_title": "Filter to prime coins",
"initial_buy_volume": "Initial-buy volume",
"last_launch": "Last launch",
"live_sol_usd_price_is_loadin_title": "Live SOL→USD price is loading. Market caps show in SOL until it arrives, then switch to USD.",
@@ -17241,6 +17425,8 @@
"agent": "Agent",
"all_events": "All events",
"any_tier": "Any tier",
+ "avatar_label": "Avatar",
+ "avatar_load_failed": "Could not load that avatar ({{reason}}). Pick another one.",
"chill": "😎 Chill",
"choose_an_avatar": "Choose an avatar",
"choose_avatar_title": "Choose avatar",
@@ -17259,7 +17445,25 @@
"discover": "Discover",
"docs": "Docs",
"emotion_mapping": "Emotion Mapping",
+ "fav_add": "Add {{name}} to favorites",
+ "fav_needs_load": "Open that avatar once before starring it.",
+ "fav_remove": "Remove {{name}} from favorites",
+ "fc_failed": "Could not load first-time claims ({{reason}}).",
+ "fc_retry": "Try again",
"feed": "📡 Feed",
+ "feed_filtered_body": "{{n}} events arrived this session but every one is filtered out. Widen the market cap, tier or size filters to see them.",
+ "feed_filtered_clear": "Clear filters",
+ "feed_filtered_title": "No events match your filters",
+ "feed_heading": "Live feed",
+ "feed_jump_new": "new",
+ "feed_offline_body": "The live pump.fun stream stopped responding after several attempts. Reconnect to try again, or reload the page.",
+ "feed_offline_retry": "Reconnect",
+ "feed_offline_title": "Feed disconnected",
+ "feed_retry_now": "Retry now",
+ "feed_retrying_body": "The live pump.fun stream dropped. Retrying on its own, with a longer wait each time.",
+ "feed_retrying_title": "Reconnecting to the stream",
+ "feed_waiting_body": "New pump.fun tokens, graduations and creator fee claims land here the moment they hit the chain.",
+ "feed_waiting_title": "Waiting for the next launch",
"first_time_fee_claims": "First-time fee claims",
"follow_along_for_builds_demos_and_conversati": "Follow along for builds, demos, and conversations with the team.",
"get_updates_on_new_features_agent_tooling": "Get updates on new features, agent tooling, and protocol changes.",
@@ -17269,7 +17473,12 @@
"hype": "🤩 Hype",
"influencer": "Influencer+",
"join_the_community": "Join the community",
+ "launch_a_coin": "Launch a coin",
"live_feed": "Live Feed",
+ "loop_pause": "Pause",
+ "loop_pause_title": "Pause the looping animation",
+ "loop_play": "Play",
+ "loop_resume_title": "Resume the looping animation",
"mega_only": "Mega only",
"meta_description": "Mint and trade pump.fun agent tokens on Solana. Live feed of every launch.",
"meta_og_description": "Mint and trade pump.fun agent tokens on Solana. Live feed of every launch.",
@@ -17284,16 +17493,33 @@
"normal": "🙂 Normal",
"notable": "Notable+",
"pause_or_resume_the_looping_title": "Pause or resume the looping animation",
+ "powered_by_pumpportal": "Powered by PumpPortal",
"privacy_policy": "Privacy Policy",
"product": "Product",
+ "pumpportal_pill_title": "Real-time pump.fun data via the PumpPortal WebSocket. The count is events received this session.",
"refresh_first_time_claims_title": "Refresh first-time claims",
"reputation_signals": "Reputation signals",
"resources": "Resources",
"retry": "Retry",
"save_configuration": "Save Configuration",
+ "share_copied": "Copied!",
+ "share_label": "Share",
+ "share_manual": "Copy this link:",
+ "status_connecting": "connecting…",
+ "status_connecting_try": "connecting (try {{n}})…",
+ "status_live": "live",
+ "status_offline": "offline · retry",
+ "status_quiet": "live · quiet",
+ "status_reconnecting": "reconnecting…",
"stay_in_the_loop": "Stay in the loop",
+ "stream_heading": "✦ Pump.fun Stream",
"studio": "Studio",
"subscribe_arialabel": "Subscribe",
+ "tab_community": "Community",
+ "tab_defaults": "Defaults",
+ "tab_favorites": "Favorites",
+ "tab_mine": "My Agents",
+ "tab_recent": "Recent",
"terms_of_use": "Terms of Use",
"three_ws": "three.ws",
"three_ws_on_github_arialabel": "three.ws on GitHub",
@@ -17302,49 +17528,7 @@
"toggle_live_feed_title": "Toggle live feed",
"toggle_new_coin_announcement_title": "Toggle new coin announcements",
"use_url": "Use URL",
- "widgets": "Widgets",
- "stream_heading": "✦ Pump.fun Stream",
- "launch_a_coin": "Launch a coin",
- "status_connecting": "connecting…",
- "status_connecting_try": "connecting (try {{n}})…",
- "status_reconnecting": "reconnecting…",
- "status_live": "live",
- "status_quiet": "live · quiet",
- "status_offline": "offline · retry",
- "feed_heading": "Live feed",
- "powered_by_pumpportal": "Powered by PumpPortal",
- "pumpportal_pill_title": "Real-time pump.fun data via the PumpPortal WebSocket. The count is events received this session.",
- "feed_jump_new": "new",
- "feed_waiting_title": "Waiting for the next launch",
- "feed_waiting_body": "New pump.fun tokens, graduations and creator fee claims land here the moment they hit the chain.",
- "feed_filtered_title": "No events match your filters",
- "feed_filtered_body": "{{n}} events arrived this session but every one is filtered out. Widen the market cap, tier or size filters to see them.",
- "feed_filtered_clear": "Clear filters",
- "feed_offline_title": "Feed disconnected",
- "feed_offline_body": "The live pump.fun stream stopped responding after several attempts. Reconnect to try again, or reload the page.",
- "feed_offline_retry": "Reconnect",
- "share_label": "Share",
- "share_copied": "Copied!",
- "share_manual": "Copy this link:",
- "loop_pause": "Pause",
- "loop_play": "Play",
- "loop_pause_title": "Pause the looping animation",
- "loop_resume_title": "Resume the looping animation",
- "avatar_label": "Avatar",
- "avatar_load_failed": "Could not load that avatar ({{reason}}). Pick another one.",
- "tab_defaults": "Defaults",
- "tab_recent": "Recent",
- "tab_favorites": "Favorites",
- "tab_community": "Community",
- "tab_mine": "My Agents",
- "fav_add": "Add {{name}} to favorites",
- "fav_remove": "Remove {{name}} from favorites",
- "fav_needs_load": "Open that avatar once before starring it.",
- "fc_failed": "Could not load first-time claims ({{reason}}).",
- "fc_retry": "Try again",
- "feed_retrying_title": "Reconnecting to the stream",
- "feed_retrying_body": "The live pump.fun stream dropped. Retrying on its own, with a longer wait each time.",
- "feed_retry_now": "Retry now"
+ "widgets": "Widgets"
},
"quality_bench": {
"fixed_23_prompt_benchmark_judged_by_vertex": "Fixed 23-prompt benchmark, judged by Vertex Gemini vision on photorealism / geometry / texture / prompt-adherence. Internal tooling — not a public surface.",
@@ -17692,10 +17876,15 @@
"agent_id": "Agent ID",
"api_keys": "API Keys ↗",
"cancel": "Cancel",
+ "cancel_2": "Cancel",
"choose_a_username_to_publish": "Choose a username above and save to publish your public profile.",
+ "choose_which_channels_deliver_each_kind": "Choose which channels deliver each kind of notification",
+ "confirm_code": "Confirm code",
+ "confirmation_phrase": "Confirmation phrase",
"connected_accounts": "Connected Accounts",
"connected_accounts_2": "Connected Accounts",
"control_what_others_can_see_about_you": "Control what others can see about you",
+ "couldnt_load_your_settings": "Couldn't load your settings",
"create": "Create",
"danger_zone": "Danger Zone",
"danger_zone_2": "Danger Zone",
@@ -17710,6 +17899,7 @@
"docs": "Docs",
"email_password_and_authentication": "Email, password, and authentication",
"fetch_your_github_activity_and_distill_it": "Fetch your GitHub activity and distill it into agent memory facts (once per 24 hours per agent).",
+ "go_to_dashboard": "Go to dashboard",
"irreversible_actions_proceed_with_care": "Irreversible actions — proceed with care",
"letters_numbers_and_only_3_30_chars": "Letters, numbers, _ and - only, 3–30 chars. Your profile URL: <span id=\"profile-url-preview\" style=\"color:#cccccc\">three.ws/u/yourhandle</span>",
"link_third_party_accounts_to_seed_your": "Link third-party accounts to seed your agent's memory",
@@ -17718,10 +17908,12 @@
"loading_sessions": "Loading sessions…",
"manage": "Manage ↗",
"manage_2": "Manage ↗",
+ "manage_3": "Manage ↗",
"mcp": "MCP ↗",
"meta_title": "Settings · three.ws",
"my_agents": "My Agents",
"new_avatars_you_upload_will_default_to": "New avatars you upload will default to this visibility. Existing avatars are not affected.",
+ "notifications": "Notifications ↗",
"permanently_delete": "Permanently delete",
"permanently_deletes_your_account_all_avatars": "Permanently deletes your account, all avatars, agents, and API keys. This cannot be undone.",
"pick_exactly_what_your_agent_reads": "Pick exactly what your agent reads. Only the items you tick below are fetched and stored, and you can delete every seeded memory at any time.",
@@ -17740,6 +17932,7 @@
"save_changes": "Save changes",
"seed_agent_memory": "Seed Agent Memory",
"seed_memory": "Seed memory",
+ "send_again": "Send again",
"sessions": "Sessions",
"sessions_2": "Sessions",
"settings": "Settings",
@@ -17747,15 +17940,19 @@
"sign_in_methods": "Sign-in methods",
"sign_out_everywhere": "Sign out everywhere",
"sign_out_of_all_devices_at_once": "Sign out of all devices at once, including any OAuth clients.",
+ "six_digit_code": "Six-digit code we emailed you",
"social_profiles": "Social Profiles",
"studio": "Studio",
"this_revokes_all_other_sessions_but_keeps": "This revokes all other sessions but keeps your current one active.",
+ "try_again": "Try again",
"type_delete_my_account_to_confirm": "Type <strong style=\"color:#eee\">delete my account</strong> to confirm:",
"unlisted_anyone_with_link": "Unlisted — anyone with link",
"username": "Username",
+ "verify_email": "Verify email",
"view_public_profile": "View public profile ↗",
"viewer": "Viewer",
"wallets": "Wallets ↗",
+ "we_could_not_reach_your_account": "We could not reach your account just now. Your settings are safe; this is a connection problem.",
"widgets": "Widgets",
"your_agents_and_public_avatars_are_visible": "Your agents and public avatars are visible on your profile page.",
"your_public_facing_identity_on_three_ws": "Your public-facing identity on three.ws"
@@ -17796,6 +17993,7 @@
"best_results_good_light_hand_in_frame": "Best results: good light, hand in frame, one letter at a time. Numbers and the full A-Z alphabet are supported.",
"chat_with_an_agent": "Chat with an agent →",
"click_start_fingerspell_a_word_at_your": "Click start, fingerspell a word at your camera, then stop. Your browser turns the video into hand and body landmarks locally; only those coordinates are sent for recognition. Webcam fingerspelling is imperfect (expect the odd wrong letter), so review the text before you trust it.",
+ "compile_signing_over_http_instead": "Compile signing over HTTP instead ↓",
"fingerspell_anything": "Fingerspell anything",
"fingerspell_into_your_webcam_and_the_ai": "Fingerspell into your webcam and the AI reads it to text: landmarks are extracted on your device, so the video never leaves your machine. The demo below runs the same recognizer.",
"gm": "gm",
@@ -17809,6 +18007,7 @@
"meta_twitter_description": "Avatars that sign in ASL: fingerspelling, signed chat replies, and webcam sign input, live in 3D.",
"meta_twitter_title": "Sign Language Avatars · three.ws",
"open_the_animation_studio": "Open the Animation Studio →",
+ "retry_the_avatar": "Retry the avatar",
"share_this_phrase": "🔗 Share this phrase",
"sign_back_with_your_camera": "Sign back with your camera",
"sign_it": "🤟 Sign it",
@@ -18500,16 +18699,24 @@
"watchlist": "Watchlist <span class=\"ct\" id=\"ctWatch\"></span>"
},
"sniper_experiments": {
+ "arm_your_own_agent": "Arm your own agent",
+ "earned_autonomy_tiers": "Earned autonomy tiers",
+ "exit_lab": "Exit Lab",
"experiments": "Experiments",
+ "how_the_sniper_works": "How the sniper works",
"meta_description": "The sniper fleet runs different rule sets side by side: rule shields, oracle gates, and LLM-judged agents with no rules at all. This is the live scoreboard of which entry conditions actually make money, every trade verifiable on-chain.",
"meta_og_description": "Rules vs LLM judgment: the live scoreboard of which sniper entry conditions actually make money.",
"meta_og_title": "Sniper Experiments · three.ws",
"meta_title": "Sniper Experiments · three.ws",
"meta_twitter_description": "Rules vs LLM judgment: the live scoreboard of which sniper entry conditions actually make money.",
"meta_twitter_title": "Sniper Experiments · three.ws",
+ "reasoning_ledger": "Reasoning ledger",
"sniper_arena": "Sniper Arena",
+ "sniper_arena_live": "Sniper Arena, live",
"sniper_experiments": "Sniper Experiments",
- "the_fleet_runs_deliberately_different_rule_s": "The fleet runs deliberately different rule sets side by side: strict rule shields, oracle-gated entries, and LLM-judged agents with no rules at all. Same market, same safety rails, different brains. This scoreboard shows which entry conditions actually make money; every fill is signed by the agent's own wallet and verifiable on-chain."
+ "the_fleet_runs_deliberately_different_rule_s": "The fleet runs deliberately different rule sets side by side: strict rule shields, oracle-gated entries, and LLM-judged agents with no rules at all. Same market, same safety rails, different brains. This scoreboard shows which entry conditions actually make money; every fill is signed by the agent's own wallet and verifiable on-chain.",
+ "trading_hub": "Trading hub",
+ "where_this_fleet_is_explained": "Where this fleet is explained"
},
"spatial_mcp_index": {
"a_third_party_mcp_server_that_returns": "A third-party MCP server that returns <code>{ url, previewImage }</code> becomes conformant with a tiny adapter; see <a href=\"/docs/spatial-mcp\">docs/spatial-mcp</a>. Any renderer that speaks this shape (this one included) then displays it. No payment, wallet, or coin surface anywhere in the shape or the renderer.",
@@ -18853,6 +19060,7 @@
"footprint_court": "Footprint court",
"generate_embed": "Generate embed",
"height_px": "Height (px)",
+ "host_your_own_glb_or_vrm": "Host your own .glb or .vrm anywhere with permissive CORS and embed it without an account. The file is never uploaded to three.ws.",
"iframe_snippet": "iframe snippet",
"include_in_embed": "Include in embed",
"launch": "⚡ Launch",
@@ -18862,9 +19070,11 @@
"meta_title": "Widget Studio · three.ws",
"meta_twitter_description": "Pick an avatar, configure embed options, copy a one-line snippet for your site.",
"meta_twitter_title": "Widget Studio · three.ws",
+ "model_url_arialabel": "Model URL (.glb or .vrm)",
"name": "Name",
"neutral": "Neutral",
"none": "None",
+ "or_paste_a_model_url": "Or paste a model URL",
"pick_an_avatar_to_preview": "Pick an avatar to preview",
"public_search_arialabel": "Search public avatars",
"public_widget_anyone_with_the_url_can": "Public widget (anyone with the URL can load it)",
@@ -18877,11 +19087,14 @@
"studio": "<a href=\"/\"><img src=\"/three.svg\" alt=\"three.ws\" class=\"wordmark-logo\" ></a><span class=\"studio-tag\">Studio</span>",
"studio_2": "Studio",
"this_embeds_the_built_in_demo_agent": "This embeds the built-in demo agent with its preset config — your studio tweaks aren't saved. <a href=\"/dashboard#upload\">Upload your own avatar</a> to embed a customized widget.",
+ "this_snippet_works_with_no_account": "This snippet works right now, with no account: the whole configuration lives in the URL. <a href=\"/login\">Sign in</a> to save it as a widget, get a shareable link, and change how it looks on live sites without touching their code again.",
"to_see_your_avatar_here_make_it": "To see your avatar here, make it public or unlisted in your <a href=\"/dashboard/avatars\">avatar dashboard</a>. Or browse the <a href=\"/gallery\" target=\"_blank\" rel=\"noopener\">community gallery</a>.",
+ "use": "Use",
"use_current_view": "Use current view",
"venice_sunset": "Venice sunset",
"viewer": "Viewer",
"want_to_try_the_viewer_full_page": "Want to try the viewer full-page with environments and embed code side by side? Open the <a href=\"/playground\">Playground</a>.",
+ "where_does_this_go": "Where does this go?",
"widgets": "Widgets",
"width_px": "Width (px)",
"your_widget_is_live": "Your widget is live"
diff --git a/scripts/i18n-home-keys.mjs b/scripts/i18n-home-keys.mjs
new file mode 100644
index 000000000..8080651ba
--- /dev/null
+++ b/scripts/i18n-home-keys.mjs
@@ -0,0 +1,220 @@
+#!/usr/bin/env node
+/**
+ * Every JS-built string in the connected-home lane, as catalog keys.
+ *
+ * The HTML extractor (scripts/i18n-extract.mjs) reads `data-i18n` annotations,
+ * which covers the lane's page shells and misses the house: the rooms, the
+ * devices, the refusals, the confirmation and every spoken announcement are
+ * assembled in JS from live data and carry no markup to annotate. Those call
+ * the bridge in src/home/i18n-home.js:
+ *
+ * t('home_scene.cancelled', 'Cancelled. Nothing moved.')
+ * plural('home_scene.desc_devices', n, '{{count}} device.', '{{count}} devices.')
+ *
+ * and the English argument IS the source value, exactly as the element's own
+ * text is for an annotated tag. This script reads those call sites and reports
+ * (or, with --write, applies) the difference against public/locales/en.json, so
+ * the catalog cannot drift from the code and a new string cannot be shipped
+ * without a key. i18n-extract preserves catalog-only keys, so a later extract
+ * run leaves everything this writes in place.
+ *
+ * node scripts/i18n-home-keys.mjs # report drift, exit 1 if any
+ * node scripts/i18n-home-keys.mjs --write # add and update keys in en.json
+ *
+ * USER DATA IS NEVER A KEY. A room name, an area name, a scene name or a device
+ * name is the user's own word and is passed through `{{vars}}`, which the
+ * translator's masker already protects byte for byte. A source string with a
+ * name baked into it would be machine-translated on the next run, so this
+ * script refuses any source value that interpolates a template expression.
+ */
+
+import { readFileSync, writeFileSync } from 'node:fs';
+import { resolve, relative } from 'node:path';
+import { pathToFileURL } from 'node:url';
+import { glob } from 'glob';
+import { ROOT, readJSON, setDeep, flatten } from './lib/i18n-shared.mjs';
+import { extractFromHtml } from './i18n-extract.mjs';
+
+const SOURCES = ['src/home/*.js', 'src/voice/home-voice-ui.js'];
+const CATALOG = 'public/locales/en.json';
+
+/**
+ * Markup built inside a JS template literal, annotated the ordinary way.
+ *
+ * A panel that assembles its own HTML (src/voice/home-voice-ui.js does) can
+ * carry `data-i18n` on its elements exactly like a page does, and the runtime's
+ * MutationObserver swaps the subtree when it mounts. What it cannot do is be
+ * seen by scripts/i18n-extract.mjs, which globs `pages/**` and `public/**` HTML
+ * FILES. Running that same extractor over the template literals in these
+ * modules closes the gap with the tested parser rather than a second one.
+ */
+function extractFromTemplates(code) {
+ const found = new Map();
+ for (const literal of templateLiterals(code)) {
+ if (!literal.includes('data-i18n')) continue;
+ for (const [key, value] of extractFromHtml(literal)) found.set(key, value);
+ }
+ return found;
+}
+
+/** Every backtick template literal in the source, contents only. */
+function templateLiterals(code) {
+ const out = [];
+ let i = 0;
+ while (i < code.length) {
+ const start = code.indexOf('`', i);
+ if (start === -1) break;
+ let j = start + 1;
+ while (j < code.length) {
+ if (code[j] === '\\') { j += 2; continue; }
+ if (code[j] === '`') break;
+ j++;
+ }
+ if (j >= code.length) break;
+ out.push(code.slice(start + 1, j));
+ i = j + 1;
+ }
+ return out;
+}
+
+/**
+ * Strip comments and then read the `t()` / `plural()` call sites.
+ *
+ * Comments come out first because the doc block above every one of these
+ * modules quotes example calls, and a scanner that could not tell a quotation
+ * from a call would put the examples in the catalog.
+ */
+export function extractHomeKeys(code) {
+ const stripped = stripComments(code);
+ const found = new Map();
+ const str = String.raw`'((?:[^'\\]|\\.)*)'`;
+ // t('key', 'source'. A computed key or a template-literal source is skipped
+ // on purpose: neither is knowable without running the program.
+ for (const m of stripped.matchAll(new RegExp(String.raw`\bt\(\s*${str}\s*,\s*${str}`, 'g'))) {
+ found.set(unescape(m[1]), unescape(m[2]));
+ }
+ // plural('key', <count>, 'one', 'other'
+ for (const m of stripped.matchAll(
+ new RegExp(String.raw`\bplural\(\s*${str}\s*,[^,]+,\s*${str}\s*,\s*${str}`, 'g'),
+ )) {
+ found.set(`${unescape(m[1])}.one`, unescape(m[2]));
+ found.set(`${unescape(m[1])}.other`, unescape(m[3]));
+ }
+ return found;
+}
+
+function unescape(value) {
+ return value.replace(/\\(['\\ntr])/g, (m, c) => ({ n: '\n', t: '\t', r: '\r' })[c] ?? c);
+}
+
+/** Remove /* *\/ and // comments without touching the contents of strings. */
+function stripComments(code) {
+ let out = '';
+ let i = 0;
+ let quote = null;
+ while (i < code.length) {
+ const c = code[i];
+ const next = code[i + 1];
+ if (quote) {
+ out += c;
+ if (c === '\\') {
+ out += next ?? '';
+ i += 2;
+ continue;
+ }
+ if (c === quote) quote = null;
+ i++;
+ continue;
+ }
+ if (c === "'" || c === '"' || c === '`') {
+ quote = c;
+ out += c;
+ i++;
+ continue;
+ }
+ if (c === '/' && next === '*') {
+ const end = code.indexOf('*/', i + 2);
+ i = end === -1 ? code.length : end + 2;
+ out += ' ';
+ continue;
+ }
+ if (c === '/' && next === '/') {
+ const end = code.indexOf('\n', i);
+ i = end === -1 ? code.length : end;
+ out += ' ';
+ continue;
+ }
+ out += c;
+ i++;
+ }
+ return out;
+}
+
+async function main() {
+ const write = process.argv.includes('--write');
+ const files = (await glob(SOURCES, { cwd: ROOT, absolute: true, nodir: true })).sort();
+ const wanted = new Map();
+ const sources = new Map();
+ const problems = [];
+
+ for (const file of files) {
+ const where = relative(ROOT, file);
+ const code = readFileSync(file, 'utf8');
+ const pairs = new Map([...extractHomeKeys(code), ...extractFromTemplates(stripComments(code))]);
+ for (const [key, value] of pairs) {
+ if (/\$\{/.test(value)) {
+ problems.push(`${where}: ${key} interpolates into its source string; pass the value through {{vars}} instead`);
+ continue;
+ }
+ const prior = wanted.get(key);
+ if (prior !== undefined && prior !== value) {
+ problems.push(`${key}: "${prior}" (${sources.get(key)}) vs "${value}" (${where})`);
+ continue;
+ }
+ wanted.set(key, value);
+ sources.set(key, where);
+ }
+ }
+
+ const path = resolve(ROOT, CATALOG);
+ const catalog = readJSON(path, {}) || {};
+ const flat = flatten(catalog);
+ const missing = [];
+ const drifted = [];
+ for (const [key, value] of wanted) {
+ const have = flat[key];
+ if (have === undefined) missing.push(key);
+ else if (have !== value) drifted.push(`${key}: catalog "${have}" vs source "${value}"`);
+ }
+
+ if (problems.length) {
+ console.error(`\n✗ ${problems.length} problem(s) in the home lane's call sites:`);
+ for (const p of problems) console.error(' ' + p);
+ }
+
+ if (write) {
+ for (const [key, value] of wanted) setDeep(catalog, key, value);
+ writeFileSync(path, JSON.stringify(deepSort(catalog), null, '\t') + '\n');
+ console.log(`i18n-home-keys: ${wanted.size} key(s) from ${files.length} file(s) written into ${CATALOG} (${missing.length} new, ${drifted.length} updated)`);
+ } else {
+ console.log(`i18n-home-keys: ${wanted.size} key(s) across ${files.length} file(s); ${missing.length} missing, ${drifted.length} drifted`);
+ for (const key of missing) console.log(` missing: ${key} = ${JSON.stringify(wanted.get(key))}`);
+ for (const line of drifted) console.log(' drift: ' + line);
+ }
+
+ if (problems.length || (!write && (missing.length || drifted.length))) process.exitCode = 1;
+}
+
+function deepSort(obj) {
+ if (obj === null || typeof obj !== 'object' || Array.isArray(obj)) return obj;
+ const out = {};
+ for (const k of Object.keys(obj).sort()) out[k] = deepSort(obj[k]);
+ return out;
+}
+
+if (import.meta.url === pathToFileURL(process.argv[1]).href) {
+ main().catch((err) => {
+ console.error(err);
+ process.exit(1);
+ });
+}
diff --git a/src/home/i18n-home.js b/src/home/i18n-home.js
new file mode 100644
index 000000000..204756601
--- /dev/null
+++ b/src/home/i18n-home.js
@@ -0,0 +1,115 @@
+/**
+ * The home lane's i18n bridge.
+ *
+ * Every page in this lane ships its static copy annotated with `data-i18n`, and
+ * /i18n.js swaps it at runtime (src/i18n.js). That covers the shell and misses
+ * the house: the rooms, the devices, the refusals, the confirmations and every
+ * spoken announcement are assembled in JS from live data, so none of it was
+ * reachable by the translation layer and all of it rendered in English in all
+ * 84 locales.
+ *
+ * This is the same bridge /play already uses (src/game/i18n-play.js), kept as a
+ * separate module rather than imported across surfaces because the two lanes
+ * ship in different bundles and neither should pull the other's graph.
+ *
+ * ── The rule that matters here ──────────────────────────────────────────────
+ *
+ * A room name, an area name, a scene name and a device name are the USER's own
+ * words. They are never translated, never extracted, and never concatenated
+ * into a translatable string. They are passed as interpolated values:
+ *
+ * t('home_scene.act_done', '{{name}}: {{action}}.', { name: object.name, ... })
+ *
+ * and never as
+ *
+ * t('home_scene.act_done', `${object.name}: turned on.`)
+ *
+ * The second form would put somebody's "Nursery" into the source catalog, ship
+ * it to a translation model, and hand back a machine-translated version of a
+ * name they chose. The first cannot: the model only ever sees `{{name}}`, which
+ * the masker in scripts/i18n-translate.mjs already protects byte for byte.
+ *
+ * `t()` never throws and never blocks. Before /i18n.js has loaded its catalog,
+ * and on any surface that never boots the runtime at all, it returns the
+ * English source the caller passed.
+ */
+
+/**
+ * Translate a key, falling back to the English source string.
+ * @param {string} key dot-path into the catalog, e.g. 'home_scene.cancelled'
+ * @param {string} fallback the English source text, with {{vars}} placeholders
+ * @param {Record<string, string|number>} [vars] interpolated values, including
+ * every piece of user data. Never bake user data into `fallback`.
+ * @returns {string}
+ */
+export function t(key, fallback, vars) {
+ const runtime = globalThis.threewsI18n;
+ if (runtime?.t) {
+ const hit = runtime.t(key, vars);
+ // The runtime echoes the key back on a total miss (no translation in the
+ // active locale and none in the English catalog either). That is a key we
+ // have not shipped yet, so the caller's source string is used rather than
+ // printing "home_scene.cancelled" at somebody standing in their kitchen.
+ if (hit && hit !== key) return hit;
+ }
+ return interpolate(fallback, vars);
+}
+
+/**
+ * Pick a form by count and translate it. English has two; the catalog carries
+ * the same two keys for every locale, and a locale whose plural rules need more
+ * than two forms says so in ITS translation of each key rather than in string
+ * concatenation here.
+ *
+ * @param {string} key base key; `.one` and `.other` are appended
+ * @param {number} count
+ * @param {string} one English source for the singular
+ * @param {string} other English source for the plural, with {{count}}
+ * @param {Record<string, string|number>} [vars]
+ */
+export function plural(key, count, one, other, vars) {
+ const merged = { count: formatNumber(count), ...vars };
+ return count === 1 ? t(`${key}.one`, one, merged) : t(`${key}.other`, other, merged);
+}
+
+/**
+ * A number in the reader's own locale: 1,024 in English, 1 024 in French,
+ * ١٬٠٢٤ in Arabic. Never `String(n)`, which is English for every locale that
+ * groups or digits differently.
+ */
+export function formatNumber(value) {
+ const n = Number(value);
+ if (!Number.isFinite(n)) return String(value);
+ try {
+ return new Intl.NumberFormat(locale()).format(n);
+ } catch {
+ return String(n);
+ }
+}
+
+/** The locale the site is currently displayed in, or the document's own. */
+export function locale() {
+ try {
+ return globalThis.threewsI18n?.getLocale?.() || document?.documentElement?.lang || 'en';
+ } catch {
+ return 'en';
+ }
+}
+
+/**
+ * Run `fn` whenever the visitor changes language, so a panel holding
+ * interpolated copy can re-render itself. Returns an unsubscribe function.
+ * @param {() => void} fn
+ * @returns {() => void}
+ */
+export function onLocaleChange(fn) {
+ if (typeof fn !== 'function' || typeof window === 'undefined') return () => {};
+ const handler = () => fn();
+ window.addEventListener('i18n:change', handler);
+ return () => window.removeEventListener('i18n:change', handler);
+}
+
+function interpolate(str, vars) {
+ if (typeof str !== 'string' || !vars) return str;
+ return str.replace(/\{\{\s*([\w.]+)\s*\}\}/g, (m, k) => (k in vars ? String(vars[k]) : m));
+}
diff --git a/src/home/scene-fallback.js b/src/home/scene-fallback.js
index f036c3c67..b56411102 100644
--- a/src/home/scene-fallback.js
+++ b/src/home/scene-fallback.js
@@ -12,15 +12,23 @@
* merely present.
*/
-/** Domains a person can act on from here, and the two services each offers. */
+import { formatNumber, locale, plural, t } from './i18n-home.js';
+
+/**
+ * Domains a person can act on from here, and the two services each offers.
+ *
+ * The third slot is a catalog key, not a label: the label is resolved at render
+ * time so switching language re-renders into the new one rather than keeping
+ * whatever was current when this module was first evaluated.
+ */
const CONTROLS = {
- light: { on: ['light', 'turn_on', 'Turn on'], off: ['light', 'turn_off', 'Turn off'] },
- switch: { on: ['switch', 'turn_on', 'Turn on'], off: ['switch', 'turn_off', 'Turn off'] },
- fan: { on: ['fan', 'turn_on', 'Turn on'], off: ['fan', 'turn_off', 'Turn off'] },
- lock: { on: ['lock', 'unlock', 'Unlock'], off: ['lock', 'lock', 'Lock'] },
- cover: { on: ['cover', 'open_cover', 'Open'], off: ['cover', 'close_cover', 'Close'] },
- media_player: { on: ['media_player', 'media_play', 'Play'], off: ['media_player', 'media_pause', 'Pause'] },
- vacuum: { on: ['vacuum', 'start', 'Start'], off: ['vacuum', 'return_to_base', 'Send home'] },
+ light: { on: ['light', 'turn_on', 'act_turn_on', 'Turn on'], off: ['light', 'turn_off', 'act_turn_off', 'Turn off'] },
+ switch: { on: ['switch', 'turn_on', 'act_turn_on', 'Turn on'], off: ['switch', 'turn_off', 'act_turn_off', 'Turn off'] },
+ fan: { on: ['fan', 'turn_on', 'act_turn_on', 'Turn on'], off: ['fan', 'turn_off', 'act_turn_off', 'Turn off'] },
+ lock: { on: ['lock', 'unlock', 'act_unlock', 'Unlock'], off: ['lock', 'lock', 'act_lock', 'Lock'] },
+ cover: { on: ['cover', 'open_cover', 'act_open', 'Open'], off: ['cover', 'close_cover', 'act_close', 'Close'] },
+ media_player: { on: ['media_player', 'media_play', 'act_play', 'Play'], off: ['media_player', 'media_pause', 'act_pause', 'Pause'] },
+ vacuum: { on: ['vacuum', 'start', 'act_start', 'Start'], off: ['vacuum', 'return_to_base', 'act_send_home', 'Send home'] },
};
/**
@@ -83,9 +91,23 @@ export function createHomeFallback(container, options = {}) {
const meta = document.createElement('p');
meta.className = 'hs-card-meta';
const bits = [];
- bits.push(room.light.total ? `${room.light.count} of ${room.light.total} lights on` : 'no lights');
- if (room.climate) bits.push(`${room.climate.label} from ${room.climate.sources} ${room.climate.sources === 1 ? 'sensor' : 'sensors'}`);
- if (room.security) bits.push(room.security.secure ? 'secure' : `${room.security.unlocked.length + room.security.open.length} open`);
+ bits.push(room.light.total
+ ? t('home_scene.flat_lights_on', '{{on}} of {{total}} lights on', { on: formatNumber(room.light.count), total: formatNumber(room.light.total) })
+ : t('home_scene.flat_no_lights', 'no lights'));
+ if (room.climate) {
+ bits.push(plural(
+ 'home_scene.flat_from_sensors',
+ room.climate.sources,
+ '{{label}} from {{count}} sensor',
+ '{{label}} from {{count}} sensors',
+ { label: room.climate.label },
+ ));
+ }
+ if (room.security) {
+ bits.push(room.security.secure
+ ? t('home_scene.flat_secure', 'secure')
+ : t('home_scene.flat_open_count', '{{count}} open', { count: formatNumber(room.security.unlocked.length + room.security.open.length) }));
+ }
meta.textContent = bits.join(' · ');
head.appendChild(meta);
card.appendChild(head);
@@ -118,7 +140,7 @@ export function createHomeFallback(container, options = {}) {
if (room.hiddenCount) {
const more = document.createElement('p');
more.className = 'hs-card-more';
- more.textContent = `${room.hiddenCount} more ${room.hiddenCount === 1 ? 'device' : 'devices'} in this room`;
+ more.textContent = plural('home_scene.flat_hidden', room.hiddenCount, '{{count}} more device in this room', '{{count}} more devices in this room');
card.appendChild(more);
}
return card;
@@ -144,19 +166,24 @@ export function createHomeFallback(container, options = {}) {
const state = document.createElement('span');
state.className = 'hs-item-state';
- state.textContent = object.available ? readableState(object) : 'unreachable';
+ state.textContent = object.available ? readableState(object) : t('home_scene.unreachable', 'unreachable');
row.appendChild(state);
const control = CONTROLS[object.domain];
if (control && object.available) {
const active = object.activity > 0.02;
- const [domain, service, label] = active ? control.off : control.on;
+ const [domain, service, key, source] = active ? control.off : control.on;
+ const label = t(`home_scene.${key}`, source);
const button = document.createElement('button');
button.type = 'button';
button.className = 'hs-item-act';
- button.textContent = busy.has(object.entityId) ? 'Working' : label;
+ button.textContent = busy.has(object.entityId) ? t('home_scene.working', 'Working') : label;
button.disabled = busy.has(object.entityId);
- button.setAttribute('aria-label', `${label} ${object.name} in ${room.name}`);
+ // The device's name and its room's name are the user's own words, so
+ // they are interpolated rather than concatenated into a translatable
+ // sentence: a catalog string with "Front Door" baked into it would be
+ // machine-translated on the next run.
+ button.setAttribute('aria-label', t('home_scene.act_aria', '{{action}} {{name}} in {{room}}', { action: label, name: object.name, room: room.name }));
button.addEventListener('click', () => {
options.onAct?.({ entityId: object.entityId, domain, service, name: object.name, roomId: room.id });
});
@@ -176,7 +203,11 @@ export function createHomeFallback(container, options = {}) {
function readableState(object) {
if (object.domain === 'cover') {
const position = Number(object.attributes?.current_position);
- if (Number.isFinite(position)) return position === 0 ? 'closed' : position === 100 ? 'open' : `${position}% open`;
+ if (Number.isFinite(position)) {
+ if (position === 0) return t('home_scene.state_closed', 'closed');
+ if (position === 100) return t('home_scene.state_open', 'open');
+ return t('home_scene.state_part_open', '{{percent}} open', { percent: percent(position) });
+ }
}
if (object.domain === 'climate') {
const current = Number(object.attributes?.current_temperature);
@@ -188,7 +219,9 @@ export function createHomeFallback(container, options = {}) {
}
if (object.domain === 'light' && object.activity > 0) {
const brightness = Number(object.attributes?.brightness);
- if (Number.isFinite(brightness)) return `on · ${Math.round((brightness / 255) * 100)}%`;
+ if (Number.isFinite(brightness)) {
+ return t('home_scene.state_on_at', 'on · {{percent}}', { percent: percent(Math.round((brightness / 255) * 100)) });
+ }
}
return String(object.state);
}
@@ -199,9 +232,17 @@ export function createHomeFallback(container, options = {}) {
const object = room.objects.find((o) => o.entityId === entityId);
names.push(object ? object.name : entityId);
}
- if (!names.length) return 'Something in this room is open.';
- const verb = room.security.unlocked.length ? 'unlocked' : 'open';
- return `${names.slice(0, 3).join(', ')}${names.length > 3 ? ` and ${names.length - 3} more` : ''} ${names.length === 1 ? 'is' : 'are'} ${verb}.`;
+ if (!names.length) return t('home_scene.something_open', 'Something in this room is open.');
+ // The device names are the user's own and are joined with the reader's own
+ // list separator; only the sentence around them is copy. English "is/are"
+ // and the "and 2 more" tail are both catalog keys so a locale can put them
+ // where its own grammar needs them.
+ const shown = names.slice(0, 3);
+ if (names.length > 3) shown.push(t('home_scene.n_more', '{{count}} more', { count: formatNumber(names.length - 3) }));
+ const extra = listFormat(shown);
+ return room.security.unlocked.length
+ ? plural('home_scene.is_unlocked', names.length, '{{names}} is unlocked.', '{{names}} are unlocked.', { names: extra })
+ : plural('home_scene.is_open', names.length, '{{names}} is open.', '{{names}} are open.', { names: extra });
}
return {
@@ -220,7 +261,9 @@ export function createHomeFallback(container, options = {}) {
},
focusRoom(roomId) {
const card = list.querySelector(`[data-room-id="${cssEscape(roomId)}"]`);
- card?.scrollIntoView({ behavior: 'smooth', block: 'center' });
+ // Someone who asked for less motion gets the card placed, not flown to.
+ const reduce = typeof matchMedia === 'function' && matchMedia('(prefers-reduced-motion: reduce)').matches;
+ card?.scrollIntoView({ behavior: reduce ? 'auto' : 'smooth', block: 'center' });
card?.classList.add('is-focused');
setTimeout(() => card?.classList.remove('is-focused'), 1800);
},
@@ -238,6 +281,24 @@ export function createHomeFallback(container, options = {}) {
};
}
+/** A percentage in the reader's own locale, never `${n}%`. */
+function percent(value) {
+ try {
+ return new Intl.NumberFormat(locale(), { style: 'percent', maximumFractionDigits: 0 }).format(Number(value) / 100);
+ } catch {
+ return `${value}%`;
+ }
+}
+
+/** "a, b and c" in the reader's own language, never a hardcoded comma-and. */
+function listFormat(items) {
+ try {
+ return new Intl.ListFormat(locale(), { style: 'long', type: 'conjunction' }).format(items);
+ } catch {
+ return items.join(', ');
+ }
+}
+
function cssEscape(value) {
return typeof CSS !== 'undefined' && CSS.escape ? CSS.escape(value) : String(value).replace(/["\\]/g, '\\$&');
}
diff --git a/src/home/scene.js b/src/home/scene.js
index 645e66ff3..8b18baa81 100644
--- a/src/home/scene.js
+++ b/src/home/scene.js
@@ -15,6 +15,7 @@
import { HomeApiError, callService, getHome, getLayout, grantEntity, openStream } from './api.js';
import { buildSceneModel } from './scene-model.js';
import { createHomeFallback, webglAvailable } from './scene-fallback.js';
+import { formatNumber, locale, plural, t } from './i18n-home.js';
const VIEW_KEY = 'three:home:view';
/** A device that cannot hold this for a few seconds is sent to the 2D house. */
@@ -110,9 +111,9 @@ boot();
async function boot() {
if (!state.homeId) {
showOverlay({
- title: 'No home in that link',
- body: 'A home scene needs a home id, as in /home/<id>. Open one from your list of connected homes.',
- actions: [{ label: 'Your homes', href: '/home', primary: true }],
+ title: t('home_scene.no_id_title', 'No home in that link'),
+ body: t('home_scene.no_id_body', 'A home scene needs a home id, as in /home/<id>. Open one from your list of connected homes.'),
+ actions: [{ label: t('home_scene.your_homes', 'Your homes'), href: '/home', primary: true }],
});
return;
}
@@ -190,8 +191,12 @@ async function load() {
try {
const payload = await getHome(state.homeId);
state.home = payload.home || null;
- el.title.textContent = state.home?.label || 'Your home';
- document.title = `${state.home?.label || 'Your home'} · three.ws`;
+ // The house's own label is the user's word for their own home: shown as
+ // they typed it, in every locale. Only the fallback for a home nobody
+ // named is ours to translate.
+ const label = state.home?.label || t('home_scene.untitled_home', 'Your home');
+ el.title.textContent = label;
+ document.title = `${label} · three.ws`;
mountRenderer();
// The authored floorplan, if anyone drew one. Best effort on purpose: a
// layout that cannot be read must never stop the house from rendering,
@@ -218,7 +223,7 @@ function subscribe() {
state.stream?.close();
state.stream = openStream(state.homeId, {
onOpen() {
- setStatus('live', 'Live');
+ setStatus('live', t('home_scene.status_live', 'Live'));
},
onGraph(payload) {
const receivedAt = performance.now();
@@ -259,9 +264,9 @@ function setStatusFromServer(payload) {
state.stale = Boolean(payload.stale);
const detail = payload.detail || payload.statusDetail;
if (status === 'auth_failed' || status === 'revoked' || status === 'disconnected') {
- setStatus('disconnected', status === 'auth_failed' ? 'Sign in again' : 'Disconnected', detail);
+ setStatus('disconnected', status === 'auth_failed' ? t('home_scene.status_reauth', 'Sign in again') : t('home_scene.status_disconnected', 'Disconnected'), detail);
} else if (status === 'unreachable' || state.stale || status === 'reconnecting' || status === 'pending' || status === 'connecting') {
- setStatus('stale', status === 'reconnecting' ? 'Reconnecting' : 'Stale', detail);
+ setStatus('stale', status === 'reconnecting' ? t('home_scene.status_reconnecting', 'Reconnecting') : t('home_scene.status_stale', 'Stale'), detail);
} else {
setStatus('live', 'Live');
}
@@ -281,7 +286,7 @@ function setStatus(kind, label, detail) {
el.stage.classList.toggle('is-stale', stale);
renderAge();
if (kind === 'disconnected') {
- announce(detail || 'The connection to your home dropped. The house below is the last state we saw.');
+ announce(detail || t('home_scene.dropped', 'The connection to your home dropped. The house below is the last state we saw.'));
}
}
@@ -360,7 +365,7 @@ function mountRenderer() {
if (want === '2d' && state.view !== '2d') {
// Not a preference: this device genuinely cannot run WebGL, and it is
// told so rather than being shown a blank canvas.
- announce('This browser cannot run WebGL, so your home is shown as a floor list you can still read and control.');
+ announce(t('home_scene.no_webgl_switched', 'This browser cannot run WebGL, so your home is shown as a floor list you can still read and control.'));
state.view = '2d';
}
setView(state.view, { remember: false, force: true });
@@ -368,7 +373,7 @@ function mountRenderer() {
function setView(view, { remember = true, force = false } = {}) {
if (view === '3d' && !webglAvailable()) {
- announce('WebGL is unavailable in this browser, so the 2D house stays on.');
+ announce(t('home_scene.no_webgl_stays', 'WebGL is unavailable in this browser, so the 2D house stays on.'));
view = '2d';
}
if (!force && view === state.view && state.renderer) return;
@@ -384,7 +389,7 @@ function setView(view, { remember = true, force = false } = {}) {
el.view2d.setAttribute('aria-pressed', String(view === '2d'));
el.viewPlan?.setAttribute('aria-pressed', String(view === 'plan'));
el.view3d.disabled = !webglAvailable();
- if (el.view3d.disabled) el.view3d.title = 'This browser cannot run WebGL.';
+ if (el.view3d.disabled) el.view3d.title = t('home_scene.no_webgl_title', 'This browser cannot run WebGL.');
state.renderer?.dispose();
state.renderer = null;
@@ -495,7 +500,7 @@ async function mount3d() {
renderEmptyStates(state.model);
}
} catch (err) {
- announce('The 3D house could not start, so the 2D house is on instead.');
+ announce(t('home_scene.render_failed', 'The 3D house could not start, so the 2D house is on instead.'));
console.warn('[home] 3D renderer failed to start', err);
setView('2d', { remember: false, force: true });
}
@@ -517,10 +522,10 @@ function startFpsWatch() {
if (stats.fps >= MIN_FPS) return;
if (state.viewChosen) {
// They asked for this view. Say what the device is doing and leave it on.
- announce(`This device is holding ${stats.fps} frames a second in the 3D house. The 2D button is faster if it feels heavy.`);
+ announce(t('home_scene.fps_kept', 'This device is holding {{fps}} frames a second in the 3D house. The 2D button is faster if it feels heavy.', { fps: formatNumber(stats.fps) }));
return;
}
- announce(`This device held only ${stats.fps} frames a second, so your home switched to the 2D view. The 3D button turns it back on.`);
+ announce(t('home_scene.fps_switched', 'This device held only {{fps}} frames a second, so your home switched to the 2D view. The 3D button turns it back on.', { fps: formatNumber(stats.fps) }));
setView('2d', { remember: false, force: true });
}, 1000);
}
@@ -541,7 +546,7 @@ function renderRooms(model) {
if (!model.rooms.length) {
const note = document.createElement('p');
note.className = 'hs-panel-empty';
- note.textContent = 'No rooms yet.';
+ note.textContent = t('home_scene.no_rooms', 'No rooms yet.');
el.rooms.appendChild(note);
return;
}
@@ -590,17 +595,17 @@ function renderRooms(model) {
meta.classList.add('hs-room-alert');
// The word carries it, not the colour: `hs-room-alert` is red AND
// says "open", and the two never disagree.
- meta.textContent = 'open';
+ meta.textContent = t('home_scene.meta_open', 'open');
} else if (room.light.total) {
// Lights on used to live only in the dot's colour, which is exactly
// the failure WCAG 1.4.1 is about. The count is the same fact in
// words, and it is more useful than the bare entity count it
// replaced: "2/5" answers "did I leave a light on in there".
- meta.textContent = `${room.light.count}/${room.light.total}`;
+ meta.textContent = t('home_scene.meta_lights', '{{on}}/{{total}}', { on: formatNumber(room.light.count), total: formatNumber(room.light.total) });
} else if (room.climate) {
meta.textContent = room.climate.label;
} else {
- meta.textContent = `${room.entityCount}`;
+ meta.textContent = formatNumber(room.entityCount);
}
button.appendChild(meta);
@@ -608,7 +613,7 @@ function renderRooms(model) {
// of the above. It replaces the button's own label rather than adding
// to it, so "Kitchen, 2 of 5" is never read as two disconnected
// fragments.
- button.setAttribute('aria-label', `${room.name}. ${describeRoom(room)}`);
+ button.setAttribute('aria-label', t('home_scene.said_room', '{{name}}. {{description}}', { name: room.name, description: describeRoom(room) }));
button.addEventListener('click', () => focusRoom(room.id));
item.appendChild(button);
@@ -652,16 +657,21 @@ function describeRoom(room) {
const bits = [];
if (room.light.total) {
bits.push(room.light.count === 0
- ? `No lights on out of ${room.light.total}.`
- : `${room.light.count} of ${room.light.total} lights on.`);
+ ? t('home_scene.desc_no_lights', 'No lights on out of {{total}}.', { total: formatNumber(room.light.total) })
+ : t('home_scene.desc_lights_on', '{{on}} of {{total}} lights on.', { on: formatNumber(room.light.count), total: formatNumber(room.light.total) }));
}
+ // The climate label is a number and the house's own unit. Neither is copy.
if (room.climate) bits.push(`${room.climate.label}.`);
if (room.security) {
+ const open = room.security.unlocked.length + room.security.open.length;
bits.push(room.security.secure
- ? 'Everything here is closed and locked.'
- : `${room.security.unlocked.length + room.security.open.length} open or unlocked.`);
+ ? t('home_scene.desc_secure', 'Everything here is closed and locked.')
+ : t('home_scene.desc_open', '{{count}} open or unlocked.', { count: formatNumber(open) }));
}
- bits.push(`${room.entityCount} ${room.entityCount === 1 ? 'device' : 'devices'}.`);
+ // Plural through the catalog, never through a ternary on an English suffix:
+ // most locales do not form a plural by adding an s, and several need forms
+ // English has no word for.
+ bits.push(plural('home_scene.desc_devices', room.entityCount, '{{count}} device.', '{{count}} devices.'));
return bits.join(' ');
}
@@ -678,7 +688,7 @@ function focusRoom(roomId) {
renderRooms(state.model);
if (hadFocus) el.rooms.querySelector(`.hs-room[data-room-id="${cssEscape(roomId)}"]`)?.focus();
const room = state.model.rooms.find((r) => r.id === roomId);
- if (room) announce(`${room.name}. ${describeRoom(room)}`);
+ if (room) announce(t('home_scene.said_room', '{{name}}. {{description}}', { name: room.name, description: describeRoom(room) }));
}
/**
@@ -706,7 +716,7 @@ function renderRoomDevices(room, id) {
name.textContent = object.name;
const value = document.createElement('span');
value.className = 'hs-room-device-state';
- value.textContent = object.available ? String(object.state) : 'unreachable';
+ value.textContent = object.available ? String(object.state) : t('home_scene.unreachable', 'unreachable');
pick.append(name, value);
pick.addEventListener('click', () => selectEntity(object.entityId, object));
li.appendChild(pick);
@@ -723,7 +733,18 @@ function selectEntity(entityId, object) {
button.setAttribute('aria-current', String(button.dataset.entityId === entityId));
}
renderInspector();
- if (object) announce(`${object.name}. ${object.available ? `Currently ${object.state}.` : 'Unreachable.'} Its controls are in the device panel.`);
+ if (object) {
+ announce(t(
+ 'home_scene.said_device',
+ '{{name}}. {{state}} Its controls are in the device panel.',
+ {
+ name: object.name,
+ state: object.available
+ ? t('home_scene.currently', 'Currently {{state}}.', { state: object.state })
+ : t('home_scene.unreachable_sentence', 'Unreachable.'),
+ },
+ ));
+ }
}
// ── inspector ────────────────────────────────────────────────────────────────
@@ -758,7 +779,9 @@ function renderInspector() {
const stateLine = document.createElement('p');
stateLine.className = 'hs-entity-state';
- stateLine.textContent = object.available ? `Currently ${object.state}.` : 'Home Assistant cannot reach this device right now.';
+ stateLine.textContent = object.available
+ ? t('home_scene.currently', 'Currently {{state}}.', { state: object.state })
+ : t('home_scene.device_unreachable', 'Home Assistant cannot reach this device right now.');
el.inspector.appendChild(stateLine);
const attrs = describeAttributes(object);
@@ -783,7 +806,7 @@ function renderInspector() {
const button = document.createElement('button');
button.type = 'button';
button.className = action.risky ? 'hs-btn hs-btn--danger' : 'hs-btn';
- button.textContent = state.busy.has(object.entityId) ? 'Working' : action.label;
+ button.textContent = state.busy.has(object.entityId) ? t('home_scene.working', 'Working') : action.label;
button.disabled = state.busy.has(object.entityId);
button.addEventListener('click', () =>
act({ entityId: object.entityId, domain: action.domain, service: action.service, name: object.name, roomId: roomOf(object.entityId)?.id }),
@@ -798,15 +821,16 @@ function renderInspector() {
function describeAttributes(object) {
const out = [];
const a = object.attributes || {};
- if (Number.isFinite(Number(a.brightness))) out.push(['Brightness', `${Math.round((Number(a.brightness) / 255) * 100)}%`]);
- if (Array.isArray(a.rgb_color)) out.push(['Colour', `rgb(${a.rgb_color.join(', ')})`]);
- if (Number.isFinite(Number(a.current_position))) out.push(['Open', `${Number(a.current_position)}%`]);
+ if (Number.isFinite(Number(a.brightness))) out.push([t('home_scene.attr_brightness', 'Brightness'), percent(Math.round((Number(a.brightness) / 255) * 100))]);
+ if (Array.isArray(a.rgb_color)) out.push([t('home_scene.attr_colour', 'Colour'), `rgb(${a.rgb_color.join(', ')})`]);
+ if (Number.isFinite(Number(a.current_position))) out.push([t('home_scene.attr_open', 'Open'), percent(Number(a.current_position))]);
// The unit the house reports, not the one the browser's locale would guess.
const unit = state.model?.temperatureUnit || '°';
- if (Number.isFinite(Number(a.current_temperature))) out.push(['Now', `${a.current_temperature}${unit}`]);
- if (Number.isFinite(Number(a.temperature))) out.push(['Set to', `${a.temperature}${unit}`]);
- if (a.device_class) out.push(['Class', String(a.device_class)]);
- if (a.media_title) out.push(['Playing', String(a.media_title)]);
+ if (Number.isFinite(Number(a.current_temperature))) out.push([t('home_scene.attr_now', 'Now'), `${formatNumber(a.current_temperature)}${unit}`]);
+ if (Number.isFinite(Number(a.temperature))) out.push([t('home_scene.attr_set_to', 'Set to'), `${formatNumber(a.temperature)}${unit}`]);
+ if (a.device_class) out.push([t('home_scene.attr_class', 'Class'), String(a.device_class)]);
+ // The track title is the media's own name, never ours to translate.
+ if (a.media_title) out.push([t('home_scene.attr_playing', 'Playing'), String(a.media_title)]);
return out.slice(0, 6);
}
@@ -817,24 +841,28 @@ function actionsFor(object) {
case 'switch':
case 'fan':
return [on
- ? { domain: object.domain, service: 'turn_off', label: 'Turn off' }
- : { domain: object.domain, service: 'turn_on', label: 'Turn on' }];
+ ? { domain: object.domain, service: 'turn_off', label: t('home_scene.act_turn_off', 'Turn off') }
+ : { domain: object.domain, service: 'turn_on', label: t('home_scene.act_turn_on', 'Turn on') }];
case 'lock':
return on
- ? [{ domain: 'lock', service: 'lock', label: 'Lock' }]
- : [{ domain: 'lock', service: 'unlock', label: 'Unlock', risky: true }];
+ ? [{ domain: 'lock', service: 'lock', label: t('home_scene.act_lock', 'Lock') }]
+ : [{ domain: 'lock', service: 'unlock', label: t('home_scene.act_unlock', 'Unlock'), risky: true }];
case 'cover':
return on
- ? [{ domain: 'cover', service: 'close_cover', label: 'Close' }]
- : [{ domain: 'cover', service: 'open_cover', label: 'Open', risky: true }];
+ ? [{ domain: 'cover', service: 'close_cover', label: t('home_scene.act_close', 'Close') }]
+ : [{ domain: 'cover', service: 'open_cover', label: t('home_scene.act_open', 'Open'), risky: true }];
case 'media_player':
- return [on ? { domain: 'media_player', service: 'media_pause', label: 'Pause' } : { domain: 'media_player', service: 'media_play', label: 'Play' }];
+ return [on
+ ? { domain: 'media_player', service: 'media_pause', label: t('home_scene.act_pause', 'Pause') }
+ : { domain: 'media_player', service: 'media_play', label: t('home_scene.act_play', 'Play') }];
case 'vacuum':
- return [on ? { domain: 'vacuum', service: 'return_to_base', label: 'Send home' } : { domain: 'vacuum', service: 'start', label: 'Start' }];
+ return [on
+ ? { domain: 'vacuum', service: 'return_to_base', label: t('home_scene.act_send_home', 'Send home') }
+ : { domain: 'vacuum', service: 'start', label: t('home_scene.act_start', 'Start') }];
case 'alarm_control_panel':
return on
- ? [{ domain: 'alarm_control_panel', service: 'alarm_disarm', label: 'Disarm', risky: true }]
- : [{ domain: 'alarm_control_panel', service: 'alarm_arm_away', label: 'Arm' }];
+ ? [{ domain: 'alarm_control_panel', service: 'alarm_disarm', label: t('home_scene.act_disarm', 'Disarm'), risky: true }]
+ : [{ domain: 'alarm_control_panel', service: 'alarm_arm_away', label: t('home_scene.act_arm', 'Arm') }];
default:
return [];
}
@@ -860,21 +888,21 @@ async function act(request, { confirmed = false, remember = false } = {}) {
confirmed,
});
dismissConfirm();
- pushLog({ text: `${request.service.replace(/_/g, ' ')} ${request.name}`, outcome: 'ok' });
- announce(`${request.name}: ${request.service.replace(/_/g, ' ')}.`);
+ pushLog({ text: t('home_scene.log_entry', '{{action}} {{name}}', { action: serviceLabel(request.service), name: request.name }), outcome: 'ok' });
+ announce(t('home_scene.act_done', '{{name}}: {{action}}.', { name: request.name, action: serviceLabel(request.service) }));
} catch (err) {
if (err instanceof HomeApiError && err.code === 'needs_confirmation') {
// The gate fired. Ask, next to the thing it would move.
state.pending = { request, message: err.message, risk: err.pending?.risk || 'physical', entityId: err.pending?.entityId || request.entityId };
- pushLog({ text: `${request.service.replace(/_/g, ' ')} ${request.name}`, outcome: 'refused' });
+ pushLog({ text: t('home_scene.log_entry', '{{action}} {{name}}', { action: serviceLabel(request.service), name: request.name }), outcome: 'refused' });
// Where the keyboard was when the gate fired. Cancelling or pressing
// Escape puts it back there, so a keyboard user is returned to the
// control they pressed instead of to the top of the document.
state.confirmReturn = document.activeElement instanceof HTMLElement ? document.activeElement : null;
renderConfirm();
} else {
- pushLog({ text: `${request.service.replace(/_/g, ' ')} ${request.name}`, outcome: 'failed' });
- announce(err.message || 'That did not work.');
+ pushLog({ text: t('home_scene.log_entry', '{{action}} {{name}}', { action: serviceLabel(request.service), name: request.name }), outcome: 'failed' });
+ announce(err.message || t('home_scene.act_failed', 'That did not work.'));
showToastError(err);
}
} finally {
@@ -898,7 +926,7 @@ function renderConfirm() {
card.className = 'hs-confirm';
card.setAttribute('role', 'alertdialog');
card.setAttribute('aria-modal', 'false');
- card.setAttribute('aria-label', 'Confirm this action');
+ card.setAttribute('aria-label', t('home_scene.confirm_aria', 'Confirm this action'));
// A screen reader reads an alertdialog's own description when focus lands
// inside it, and the description is these three paragraphs in order: the
// risk band, the question, and the reason the gate stopped it.
@@ -908,14 +936,20 @@ function renderConfirm() {
const risk = document.createElement('p');
risk.className = 'hs-confirm-risk';
risk.id = `${cardId}-risk`;
- risk.textContent = pending.risk === 'security' ? 'Opens your home' : 'Moves something physical';
+ risk.textContent = pending.risk === 'security'
+ ? t('home_scene.risk_security', 'Opens your home')
+ : t('home_scene.risk_physical', 'Moves something physical');
card.appendChild(risk);
const text = document.createElement('p');
text.className = 'hs-confirm-text';
text.id = `${cardId}-q`;
const object = findObject(pending.entityId);
- text.textContent = `${pending.request.service.replace(/_/g, ' ')} ${object?.name || pending.request.name}?`;
+ // The question, with the user's own name for the thing interpolated in.
+ text.textContent = t('home_scene.confirm_question', '{{action}} {{name}}?', {
+ action: serviceLabel(pending.request.service),
+ name: object?.name || pending.request.name,
+ });
card.appendChild(text);
const why = document.createElement('p');
@@ -930,7 +964,7 @@ function renderConfirm() {
const yes = document.createElement('button');
yes.type = 'button';
yes.className = 'hs-btn hs-btn--primary';
- yes.textContent = 'Yes, do it';
+ yes.textContent = t('home_scene.confirm_yes', 'Yes, do it');
yes.addEventListener('click', () => {
const remember = card.querySelector('input')?.checked;
const request = pending.request;
@@ -945,11 +979,11 @@ function renderConfirm() {
const no = document.createElement('button');
no.type = 'button';
no.className = 'hs-btn';
- no.textContent = 'Cancel';
+ no.textContent = t('home_scene.confirm_no', 'Cancel');
no.addEventListener('click', () => {
state.pending = null;
dismissConfirm({ restoreFocus: true });
- announce('Cancelled. Nothing moved.');
+ announce(t('home_scene.cancelled', 'Cancelled. Nothing moved.'));
});
row.append(yes, no);
card.appendChild(row);
@@ -958,7 +992,9 @@ function renderConfirm() {
rememberLabel.className = 'hs-confirm-remember';
const checkbox = document.createElement('input');
checkbox.type = 'checkbox';
- rememberLabel.append(checkbox, document.createTextNode(`Do not ask again for ${object?.name || 'this device'}`));
+ rememberLabel.append(checkbox, document.createTextNode(t('home_scene.confirm_remember', 'Do not ask again for {{name}}', {
+ name: object?.name || t('home_scene.this_device', 'this device'),
+ })));
card.appendChild(rememberLabel);
el.stage.appendChild(card);
@@ -969,7 +1005,11 @@ function renderConfirm() {
yes.focus();
// Assertive, and self-contained: a reader that lands on the Yes button hears
// the button, not the question, so the question is said in full here.
- alertAssertive(`${risk.textContent}. ${text.textContent} ${pending.message} Answer with the Yes or Cancel button, or press Escape to cancel.`);
+ alertAssertive(t(
+ 'home_scene.confirm_spoken',
+ '{{risk}}. {{question}} {{why}} Answer with the Yes or Cancel button, or press Escape to cancel.',
+ { risk: risk.textContent, question: text.textContent, why: pending.message },
+ ));
}
/**
@@ -1028,7 +1068,7 @@ function onKeydown(event) {
if (event.key === 'Escape' && state.pending) {
state.pending = null;
dismissConfirm({ restoreFocus: true });
- announce('Cancelled. Nothing moved.');
+ announce(t('home_scene.cancelled', 'Cancelled. Nothing moved.'));
}
}
@@ -1037,18 +1077,18 @@ function onKeydown(event) {
function renderEmptyStates(model) {
if (model.empty) {
showOverlay({
- title: 'Your home is connected, and empty',
- body: 'Home Assistant answered, but it is not exposing any devices yet. Add an integration in Home Assistant (Settings, Devices and services), and this scene fills in as soon as the first device appears. Nothing else to do here.',
- actions: [{ label: 'Add a device in Home Assistant', href: integrationsUrl(), external: true, primary: true }],
+ title: t('home_scene.empty_title', 'Your home is connected, and empty'),
+ body: t('home_scene.empty_body', 'Home Assistant answered, but it is not exposing any devices yet. Add an integration in Home Assistant (Settings, Devices and services), and this scene fills in as soon as the first device appears. Nothing else to do here.'),
+ actions: [{ label: t('home_scene.empty_action', 'Add a device in Home Assistant'), href: integrationsUrl(), external: true, primary: true }],
});
return;
}
if (model.needsLayout) {
showOverlay({
- title: 'Nothing is in a room yet',
- body: 'Every device in this house is unfiled, so they are all in one room below. Assign them to areas in Home Assistant (Settings, Areas and zones) or lay the house out here, and the scene splits into real rooms.',
+ title: t('home_scene.unfiled_title', 'Nothing is in a room yet'),
+ body: t('home_scene.unfiled_body', 'Every device in this house is unfiled, so they are all in one room below. Assign them to areas in Home Assistant (Settings, Areas and zones) or lay the house out here, and the scene splits into real rooms.'),
actions: [
- { label: 'Assign rooms in Home Assistant', href: areasUrl(), external: true, primary: true },
+ { label: t('home_scene.unfiled_action', 'Assign rooms in Home Assistant'), href: areasUrl(), external: true, primary: true },
],
dismissable: true,
});
@@ -1089,7 +1129,7 @@ function showOverlay({ title, body, actions = [], dismissable = false }) {
const close = document.createElement('button');
close.type = 'button';
close.className = 'hs-btn';
- close.textContent = 'Show me the house anyway';
+ close.textContent = t('home_scene.overlay_dismiss', 'Show me the house anyway');
close.addEventListener('click', hideOverlay);
row.appendChild(close);
}
@@ -1107,36 +1147,36 @@ function renderFailure(err) {
const code = err instanceof HomeApiError ? err.code : 'call_failed';
const copy = {
unauthorized: {
- title: 'Sign in to see this home',
- body: 'A home belongs to the account that connected it. Sign in and this page opens straight onto your house.',
- actions: [{ label: 'Sign in', href: `/login?next=${encodeURIComponent(location.pathname)}`, primary: true }],
+ title: t('home_scene.err_auth_title', 'Sign in to see this home'),
+ body: t('home_scene.err_auth_body', 'A home belongs to the account that connected it. Sign in and this page opens straight onto your house.'),
+ actions: [{ label: t('home_scene.sign_in', 'Sign in'), href: `/login?next=${encodeURIComponent(location.pathname)}`, primary: true }],
},
not_found: {
- title: 'That home is not here',
- body: 'Either this home was removed, or it belongs to another account. Your connected homes are one click away.',
- actions: [{ label: 'Your homes', href: '/home', primary: true }],
+ title: t('home_scene.err_missing_title', 'That home is not here'),
+ body: t('home_scene.err_missing_body', 'Either this home was removed, or it belongs to another account. Your connected homes are one click away.'),
+ actions: [{ label: t('home_scene.your_homes', 'Your homes'), href: '/home', primary: true }],
},
auth: {
- title: 'Home Assistant rejected the token',
- body: 'The long-lived access token this home was connected with no longer works. Create a new one in Home Assistant (your profile, Security) and reconnect.',
- actions: [{ label: 'Reconnect this home', href: '/home', primary: true }],
+ title: t('home_scene.err_token_title', 'Home Assistant rejected the token'),
+ body: t('home_scene.err_token_body', 'The long-lived access token this home was connected with no longer works. Create a new one in Home Assistant (your profile, Security) and reconnect.'),
+ actions: [{ label: t('home_scene.err_token_action', 'Reconnect this home'), href: '/home', primary: true }],
},
unreachable: {
- title: 'Your home did not answer',
- body: 'three.ws could not reach this Home Assistant. If it only exists on your home network, a public server cannot route to it: use your remote https URL, or run the three.ws add-on inside the network.',
- actions: [{ label: 'Try again', onClick: () => reconnect(), primary: true }, { label: 'Connection settings', href: '/home' }],
+ title: t('home_scene.err_unreachable_title', 'Your home did not answer'),
+ body: t('home_scene.err_unreachable_body', 'three.ws could not reach this Home Assistant. If it only exists on your home network, a public server cannot route to it: use your remote https URL, or run the three.ws add-on inside the network.'),
+ actions: [{ label: t('home_scene.try_again', 'Try again'), onClick: () => reconnect(), primary: true }, { label: t('home_scene.connection_settings', 'Connection settings'), href: '/home' }],
},
not_connected: {
- title: 'Still opening the connection',
- body: 'The link to your house is coming up, or was paused after repeated failures. Give it a moment and try again.',
- actions: [{ label: 'Try again', onClick: () => reconnect(), primary: true }],
+ title: t('home_scene.err_pending_title', 'Still opening the connection'),
+ body: t('home_scene.err_pending_body', 'The link to your house is coming up, or was paused after repeated failures. Give it a moment and try again.'),
+ actions: [{ label: t('home_scene.try_again', 'Try again'), onClick: () => reconnect(), primary: true }],
},
}[code] || {
- title: 'Something went wrong loading your home',
- body: err?.message || 'The request failed. Trying again usually works; if it keeps failing, the connection settings will say why.',
- actions: [{ label: 'Try again', onClick: () => reconnect(), primary: true }, { label: 'Connection settings', href: '/home' }],
+ title: t('home_scene.err_generic_title', 'Something went wrong loading your home'),
+ body: err?.message || t('home_scene.err_generic_body', 'The request failed. Trying again usually works; if it keeps failing, the connection settings will say why.'),
+ actions: [{ label: t('home_scene.try_again', 'Try again'), onClick: () => reconnect(), primary: true }, { label: t('home_scene.connection_settings', 'Connection settings'), href: '/home' }],
};
- setStatus('disconnected', 'Disconnected', err?.message);
+ setStatus('disconnected', t('home_scene.status_disconnected', 'Disconnected'), err?.message);
showOverlay(copy);
announce(copy.body);
}
@@ -1144,7 +1184,7 @@ function renderFailure(err) {
function showToastError(err) {
// A failed action is reported in the log and the live region rather than as
// a modal: the house is still on screen and still usable.
- pushLog({ text: err?.message || 'Action failed', outcome: 'failed' });
+ pushLog({ text: err?.message || t('home_scene.action_failed', 'Action failed'), outcome: 'failed' });
}
function renderAge() {
@@ -1160,7 +1200,9 @@ function renderAge() {
const node = existing || document.createElement('div');
node.className = 'hs-age';
const write = () => {
- node.textContent = `Last seen ${relativeAge(Date.now() - state.lastGraphAt)}. Showing the house as it was.`;
+ node.textContent = t('home_scene.last_seen', 'Last seen {{ago}}. Showing the house as it was.', {
+ ago: relativeAge(Date.now() - state.lastGraphAt),
+ });
};
write();
if (!existing) {
@@ -1169,13 +1211,21 @@ function renderAge() {
}
}
+/**
+ * "2 minutes ago", in the reader's language, through Intl.RelativeTimeFormat.
+ *
+ * Not three catalog keys with an English `s` suffix bolted on: that spelling of
+ * a plural is wrong in most of the 84 locales this ships in, and several need
+ * forms English has no word for. The platform already knows all of them.
+ */
function relativeAge(ms) {
const s = Math.max(0, Math.round(ms / 1000));
- if (s < 60) return `${s} second${s === 1 ? '' : 's'} ago`;
- const m = Math.round(s / 60);
- if (m < 60) return `${m} minute${m === 1 ? '' : 's'} ago`;
- const h = Math.round(m / 60);
- return `${h} hour${h === 1 ? '' : 's'} ago`;
+ const [value, unit] = s < 60 ? [s, 'second'] : s < 3600 ? [Math.round(s / 60), 'minute'] : [Math.round(s / 3600), 'hour'];
+ try {
+ return new Intl.RelativeTimeFormat(locale(), { numeric: 'always' }).format(-value, unit);
+ } catch {
+ return `${value} ${unit}${value === 1 ? '' : 's'} ago`;
+ }
}
function pushLog(entry) {
@@ -1197,9 +1247,13 @@ function renderLog() {
if (entry.outcome !== 'ok') li.className = entry.outcome === 'refused' ? 'is-refused' : 'is-failed';
const time = document.createElement('time');
time.dateTime = entry.at.toISOString();
- time.textContent = entry.at.toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' });
+ // The site's locale, not the browser's: someone reading three.ws in
+ // Japanese should not get a US clock because their OS is set that way.
+ time.textContent = entry.at.toLocaleTimeString(locale(), { hour: '2-digit', minute: '2-digit' });
const text = document.createElement('span');
- text.textContent = entry.outcome === 'refused' ? `${entry.text} (needs your yes)` : entry.text;
+ text.textContent = entry.outcome === 'refused'
+ ? t('home_scene.log_needs_yes', '{{entry}} (needs your yes)', { entry: entry.text })
+ : entry.text;
li.append(time, text);
list.appendChild(li);
}
@@ -1293,6 +1347,28 @@ function integrationsUrl() {
return state.home?.base_url ? `${state.home.base_url}/config/integrations` : null;
}
+/**
+ * A Home Assistant service id as words: `open_cover` reads "open cover".
+ *
+ * Deliberately NOT a catalog key. The set of services is the union of what
+ * 1,500 integrations expose in the user's own instance, so it is unbounded and
+ * it is their house's vocabulary rather than our copy. Translating a guessed
+ * subset of it and leaving the rest in English would read worse than leaving
+ * the machine name legible everywhere.
+ */
+function serviceLabel(service) {
+ return String(service || '').replace(/_/g, ' ');
+}
+
+/** A percentage in the reader's own locale, never `${n}%`. */
+function percent(value) {
+ try {
+ return new Intl.NumberFormat(locale(), { style: 'percent', maximumFractionDigits: 0 }).format(Number(value) / 100);
+ } catch {
+ return `${value}%`;
+ }
+}
+
function clamp(value, min, max) {
return Math.min(max, Math.max(min, value));
}
diff --git a/src/voice/home-voice-ui.js b/src/voice/home-voice-ui.js
index 9d4d8b2f7..335a267c9 100644
--- a/src/voice/home-voice-ui.js
+++ b/src/voice/home-voice-ui.js
@@ -21,63 +21,88 @@
* agreement.
*/
+import { t } from '../home/i18n-home.js';
import { STATES } from './home-voice.js';
import { WAKE_WORDS } from './wake-words.js';
-/** Everything the panel says, in one place, so the copy can be read as copy. */
+/**
+ * Everything the panel says, in one place, so the copy can be read as copy.
+ *
+ * Each field is a catalog key plus its English source, resolved at render time
+ * rather than at module load: this object is evaluated once when the bundle
+ * parses, which is before /i18n.js has a catalog, so baking the strings in here
+ * would pin the panel to English for the whole session no matter what language
+ * the visitor picked.
+ */
const COPY = {
[STATES.OFF]: {
- badge: 'Off',
- title: 'Hands-free is off',
- body: 'Turn it on and you can talk to your house without finding a phone. It stays off until you say so.',
+ badge: ['home_voice.off_badge', 'Off'],
+ title: ['home_voice.off_title', 'Hands-free is off'],
+ body: ['home_voice.off_body', 'Turn it on and you can talk to your house without finding a phone. It stays off until you say so.'],
},
[STATES.PERMISSION_PENDING]: {
- badge: 'Waiting',
- title: 'Your browser is asking',
- body: 'Choose Allow in the microphone prompt. Nothing is captured until you do.',
+ badge: ['home_voice.permission_pending_badge', 'Waiting'],
+ title: ['home_voice.permission_pending_title', 'Your browser is asking'],
+ body: ['home_voice.permission_pending_body', 'Choose Allow in the microphone prompt. Nothing is captured until you do.'],
},
[STATES.PERMISSION_DENIED]: {
- badge: 'Blocked',
- title: 'The microphone is blocked',
- body: 'Hands-free needs the mic. You can keep using the agent by typing in the meantime.',
+ badge: ['home_voice.permission_denied_badge', 'Blocked'],
+ title: ['home_voice.permission_denied_title', 'The microphone is blocked'],
+ body: ['home_voice.permission_denied_body', 'Hands-free needs the mic. You can keep using the agent by typing in the meantime.'],
},
[STATES.IDLE]: {
- badge: 'Listening for the wake word',
- title: 'Say the wake word',
- body: 'Everything is being matched on this device. Nothing is sent anywhere until you say it.',
+ badge: ['home_voice.idle_badge', 'Listening for the wake word'],
+ title: ['home_voice.idle_title', 'Say the wake word'],
+ body: ['home_voice.idle_body', 'Everything is being matched on this device. Nothing is sent anywhere until you say it.'],
},
[STATES.CAPTURING]: {
- badge: 'Listening',
- title: 'Go ahead',
- body: 'This part of what you say is sent for transcription, and nothing else is.',
+ badge: ['home_voice.capturing_badge', 'Listening'],
+ title: ['home_voice.capturing_title', 'Go ahead'],
+ body: ['home_voice.capturing_body', 'This part of what you say is sent for transcription, and nothing else is.'],
+ },
+ [STATES.THINKING]: {
+ badge: ['home_voice.thinking_badge', 'Thinking'],
+ title: ['home_voice.thinking_title', 'Working on it'],
+ body: ['home_voice.thinking_body', 'Reading the house and deciding what to do.'],
+ },
+ [STATES.SPEAKING]: {
+ badge: ['home_voice.speaking_badge', 'Speaking'],
+ title: ['home_voice.speaking_title', 'Answering'],
+ body: ['home_voice.speaking_body', 'Talk over it any time and it will stop.'],
+ },
+ [STATES.BARGED_IN]: {
+ badge: ['home_voice.barged_in_badge', 'Interrupted'],
+ title: ['home_voice.barged_in_title', 'Stopped'],
+ body: ['home_voice.barged_in_body', 'Listening to you instead.'],
},
- [STATES.THINKING]: { badge: 'Thinking', title: 'Working on it', body: 'Reading the house and deciding what to do.' },
- [STATES.SPEAKING]: { badge: 'Speaking', title: 'Answering', body: 'Talk over it any time and it will stop.' },
- [STATES.BARGED_IN]: { badge: 'Interrupted', title: 'Stopped', body: 'Listening to you instead.' },
[STATES.CONFIRM_PENDING]: {
- badge: 'Waiting for you',
- title: 'This one needs a yes',
- body: 'Say the word confirm, or press the button. Nothing else counts.',
+ badge: ['home_voice.confirm_pending_badge', 'Waiting for you'],
+ title: ['home_voice.confirm_pending_title', 'This one needs a yes'],
+ body: ['home_voice.confirm_pending_body', 'Say the word confirm, or press the button. Nothing else counts.'],
},
[STATES.UNAVAILABLE]: {
- badge: 'Unavailable',
- title: 'Voice is not available here',
- body: 'Speech recognition is not configured in this deployment, so the microphone stays off.',
+ badge: ['home_voice.unavailable_badge', 'Unavailable'],
+ title: ['home_voice.unavailable_title', 'Voice is not available here'],
+ body: ['home_voice.unavailable_body', 'Speech recognition is not configured in this deployment, so the microphone stays off.'],
},
[STATES.MUTED]: {
- badge: 'Muted',
- title: 'The microphone is stopped',
- body: 'Capture is stopped at the device, not hidden behind a setting.',
+ badge: ['home_voice.muted_badge', 'Muted'],
+ title: ['home_voice.muted_title', 'The microphone is stopped'],
+ body: ['home_voice.muted_body', 'Capture is stopped at the device, not hidden behind a setting.'],
+ },
+ [STATES.ERROR]: {
+ badge: ['home_voice.error_badge', 'Problem'],
+ title: ['home_voice.error_title', 'Something went wrong'],
+ body: ['home_voice.error_body', ''],
},
- [STATES.ERROR]: { badge: 'Problem', title: 'Something went wrong', body: '' },
};
const CONSENT_POINTS = [
- 'The wake word is matched here, in this tab, by a model downloaded to your device. That audio never leaves.',
- 'Only what you say after the wake word is uploaded, and only to transcribe it.',
- 'Nothing is kept. The audio is not stored on our servers once the request is answered.',
- 'While the microphone is live there is an indicator on this page that cannot be turned off.',
- 'One tap on Mute stops the microphone at the device. You can turn hands-free off completely at any time.',
+ ['home_voice.consent_1', 'The wake word is matched here, in this tab, by a model downloaded to your device. That audio never leaves.'],
+ ['home_voice.consent_2', 'Only what you say after the wake word is uploaded, and only to transcribe it.'],
+ ['home_voice.consent_3', 'Nothing is kept. The audio is not stored on our servers once the request is answered.'],
+ ['home_voice.consent_4', 'While the microphone is live there is an indicator on this page that cannot be turned off.'],
+ ['home_voice.consent_5', 'One tap on Mute stops the microphone at the device. You can turn hands-free off completely at any time.'],
];
export class HomeVoicePanel {
@@ -121,45 +146,45 @@ export class HomeVoicePanel {
this.mount.innerHTML = `
<div class="hv-indicator" data-live="false" role="status" aria-live="polite">
<span class="hv-dot" aria-hidden="true"></span>
- <span class="hv-indicator-text">Microphone off</span>
+ <span class="hv-indicator-text" data-i18n="home_voice.mic_off">Microphone off</span>
</div>
<div class="hv-head">
<div>
- <span class="hv-badge" data-state="off">Off</span>
- <h2 class="hv-title">Hands-free is off</h2>
+ <span class="hv-badge" data-state="off" data-i18n="home_voice.off_badge">Off</span>
+ <h2 class="hv-title" data-i18n="home_voice.off_title">Hands-free is off</h2>
<p class="hv-body"></p>
</div>
<div class="hv-actions"></div>
</div>
<div class="hv-consent" hidden>
- <h3>Before you turn this on</h3>
+ <h3 data-i18n="home_voice.consent_heading">Before you turn this on</h3>
<ul class="hv-consent-list"></ul>
<div class="hv-consent-actions">
- <button type="button" class="hv-btn hv-btn-primary" data-act="consent">Turn on hands-free</button>
- <button type="button" class="hv-btn" data-act="cancel-consent">Not now</button>
+ <button type="button" class="hv-btn hv-btn-primary" data-act="consent" data-i18n="home_voice.act_consent">Turn on hands-free</button>
+ <button type="button" class="hv-btn" data-act="cancel-consent" data-i18n="home_voice.act_not_now">Not now</button>
</div>
</div>
<div class="hv-recovery" hidden></div>
<div class="hv-confirm" hidden>
<p class="hv-confirm-sentence"></p>
<ul class="hv-confirm-entities"></ul>
- <p class="hv-confirm-hint">Say <strong>confirm</strong> to continue. A general yes does not count.</p>
+ <p class="hv-confirm-hint" data-i18n-html="home_voice.confirm_hint">Say <strong>confirm</strong> to continue. A general yes does not count.</p>
<div class="hv-confirm-actions">
- <button type="button" class="hv-btn hv-btn-primary" data-act="confirm">Confirm</button>
- <button type="button" class="hv-btn" data-act="cancel-confirm">Cancel</button>
+ <button type="button" class="hv-btn hv-btn-primary" data-act="confirm" data-i18n="home_voice.act_confirm">Confirm</button>
+ <button type="button" class="hv-btn" data-act="cancel-confirm" data-i18n="home_voice.act_cancel">Cancel</button>
</div>
<div class="hv-confirm-timer"><span></span></div>
</div>
<div class="hv-meter" hidden aria-hidden="true"><span class="hv-meter-fill"></span></div>
- <ol class="hv-transcript" aria-label="Conversation"></ol>
+ <ol class="hv-transcript" aria-label="Conversation" data-i18n-attr="aria-label:home_voice.transcript_aria"></ol>
<div class="hv-settings">
<label class="hv-field">
- <span>Wake word</span>
- <select class="hv-wake" aria-label="Wake word"></select>
+ <span data-i18n="home_voice.wake_word">Wake word</span>
+ <select class="hv-wake" aria-label="Wake word" data-i18n-attr="aria-label:home_voice.wake_word"></select>
</label>
<p class="hv-wake-hint"></p>
</div>
- <dl class="hv-latency" aria-label="Measured latency"></dl>
+ <dl class="hv-latency" aria-label="Measured latency" data-i18n-attr="aria-label:home_voice.latency_aria"></dl>
`;
this.el = {
@@ -184,9 +209,9 @@ export class HomeVoicePanel {
latency: this.mount.querySelector('.hv-latency'),
};
- for (const point of CONSENT_POINTS) {
+ for (const [key, source] of CONSENT_POINTS) {
const li = document.createElement('li');
- li.textContent = point;
+ li.textContent = t(key, source);
this.el.consentList.appendChild(li);
}
@@ -260,23 +285,25 @@ export class HomeVoicePanel {
this._appendLine('you', event.text);
break;
case 'wake':
- this._appendLine('system', `Woke on "${wakePhrase(event.wakeWord)}" (${event.score.toFixed(2)}).`);
+ // The wake phrase is a setting the user chose, interpolated rather
+ // than folded into the sentence.
+ this._appendLine('system', t('home_voice.line_woke', 'Woke on "{{phrase}}" ({{score}}).', { phrase: wakePhrase(event.wakeWord), score: event.score.toFixed(2) }));
break;
case 'barge-in':
- this._appendLine('system', 'You interrupted, so it stopped talking.');
+ this._appendLine('system', t('home_voice.line_barge_in', 'You interrupted, so it stopped talking.'));
break;
case 'guarded-refused':
- this._appendLine('system', 'Refused: a guarded action cannot be confirmed by voice on a screenless device.');
+ this._appendLine('system', t('home_voice.line_guarded_refused', 'Refused: a guarded action cannot be confirmed by voice on a screenless device.'));
break;
case 'confirmation-not-token':
- this._appendLine('system', 'That was not the word confirm, so nothing was unlocked.');
+ this._appendLine('system', t('home_voice.line_not_token', 'That was not the word confirm, so nothing was unlocked.'));
break;
case 'confirmation-executed':
- this._appendLine('system', 'Confirmed and carried out.');
+ this._appendLine('system', t('home_voice.line_confirmed', 'Confirmed and carried out.'));
break;
case 'confirmation-closed':
- if (event.reason === 'expired') this._appendLine('system', 'The confirmation expired. Nothing changed.');
- if (event.reason === 'cancelled') this._appendLine('system', 'Cancelled. Nothing changed.');
+ if (event.reason === 'expired') this._appendLine('system', t('home_voice.line_expired', 'The confirmation expired. Nothing changed.'));
+ if (event.reason === 'cancelled') this._appendLine('system', t('home_voice.line_cancelled', 'Cancelled. Nothing changed.'));
break;
case 'tts-failed':
this._appendLine('agent', event.text);
@@ -301,21 +328,27 @@ export class HomeVoicePanel {
_syncIndicator() {
const live = this.loop.micLive;
this.el.indicator.dataset.live = String(live);
+ this.el.indicatorText.setAttribute('data-i18n-owned', '1');
this.el.indicatorText.textContent = live
? this.loop.state === STATES.CAPTURING
- ? 'Microphone live, and this is being sent for transcription'
- : 'Microphone live, matching the wake word on this device'
+ ? t('home_voice.mic_live_sending', 'Microphone live, and this is being sent for transcription')
+ : t('home_voice.mic_live_local', 'Microphone live, matching the wake word on this device')
: this.loop.muted
- ? 'Microphone stopped'
- : 'Microphone off';
+ ? t('home_voice.mic_stopped', 'Microphone stopped')
+ : t('home_voice.mic_off', 'Microphone off');
}
_render(state, detail) {
const copy = COPY[state] || COPY[STATES.ERROR];
- this.el.badge.textContent = copy.badge;
+ // The template ships the OFF strings with data-i18n on them, and from the
+ // first render onwards this script owns those three nodes: without the
+ // marker the catalog pass would put "Hands-free is off" back over a live
+ // "Listening" the moment the locale finished loading.
+ for (const node of [this.el.badge, this.el.title, this.el.body]) node.setAttribute('data-i18n-owned', '1');
+ this.el.badge.textContent = t(...copy.badge);
this.el.badge.dataset.state = state;
- this.el.title.textContent = copy.title;
- this.el.body.textContent = detail?.message || detail?.reason || detail?.note || copy.body;
+ this.el.title.textContent = t(...copy.title);
+ this.el.body.textContent = detail?.message || detail?.reason || detail?.note || t(...copy.body);
this.mount.dataset.state = state;
this._syncIndicator();
@@ -364,16 +397,16 @@ export class HomeVoicePanel {
_renderActions(state) {
const buttons = [];
if (state === STATES.OFF) {
- buttons.push(['ask-consent', 'Turn on hands-free', true]);
+ buttons.push(['ask-consent', t('home_voice.act_consent', 'Turn on hands-free'), true]);
} else if (state === STATES.PERMISSION_DENIED || state === STATES.ERROR) {
- buttons.push(['retry', 'Try again', true]);
- buttons.push(['off', 'Turn hands-free off', false]);
+ buttons.push(['retry', t('home_voice.act_retry', 'Try again'), true]);
+ buttons.push(['off', t('home_voice.act_off', 'Turn hands-free off'), false]);
} else if (state === STATES.MUTED) {
- buttons.push(['unmute', 'Unmute', true]);
- buttons.push(['off', 'Turn hands-free off', false]);
+ buttons.push(['unmute', t('home_voice.act_unmute', 'Unmute'), true]);
+ buttons.push(['off', t('home_voice.act_off', 'Turn hands-free off'), false]);
} else if (state !== STATES.UNAVAILABLE && state !== STATES.PERMISSION_PENDING) {
- buttons.push(['mute', 'Mute', false]);
- buttons.push(['off', 'Turn hands-free off', false]);
+ buttons.push(['mute', t('home_voice.act_mute', 'Mute'), false]);
+ buttons.push(['off', t('home_voice.act_off', 'Turn hands-free off'), false]);
}
this.el.actions.replaceChildren();
for (const [act, label, primary] of buttons) {
@@ -398,14 +431,14 @@ export class HomeVoicePanel {
firstAudio: 1800,
};
const labels = {
- wake: 'Wake word',
- endpoint: 'End of speech',
- asr: 'Transcription',
- turn: 'Agent turn',
- toolCall: 'First tool call',
- action: 'Action to device',
- firstAudio: 'First audible reply',
- tts: 'Speech synthesis',
+ wake: t('home_voice.wake_word', 'Wake word'),
+ endpoint: t('home_voice.leg_endpoint', 'End of speech'),
+ asr: t('home_voice.leg_asr', 'Transcription'),
+ turn: t('home_voice.leg_turn', 'Agent turn'),
+ toolCall: t('home_voice.leg_tool_call', 'First tool call'),
+ action: t('home_voice.leg_action', 'Action to device'),
+ firstAudio: t('home_voice.leg_first_audio', 'First audible reply'),
+ tts: t('home_voice.leg_tts', 'Speech synthesis'),
};
this.el.latency.replaceChildren();
for (const [leg, stats] of Object.entries(summary)) {
@@ -417,11 +450,11 @@ export class HomeVoicePanel {
const dt = document.createElement('dt');
dt.textContent = labels[leg] || leg;
const dd = document.createElement('dd');
- dd.textContent = `${stats.median} ms`;
+ dd.textContent = t('home_voice.ms', '{{n}} ms', { n: stats.median });
const budget = budgets[leg];
if (budget) {
dd.dataset.over = String(stats.median > budget);
- dd.title = `Budget ${budget} ms, worst ${stats.worst} ms over ${stats.count}`;
+ dd.title = t('home_voice.budget', 'Budget {{budget}} ms, worst {{worst}} ms over {{count}}', { budget, worst: stats.worst, count: stats.count });
}
pair.append(dt, dd);
this.el.latency.appendChild(pair);