Skip to content

Commit 49351e2

Browse files
vasilev-alexclaude
andauthored
docs: document language support for embedded surfaces (cube-js#11186)
Add a Localization page covering the supported languages, the account-wide default (Embed β†’ Settings β†’ Language), the per-embed ?locale= URL parameter, and the runtime cube:action:set-locale override, with the precedence order between them. Cross-link from the dashboards, events, and customization pages and register the new page in docs.json. Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 1435d0a commit 49351e2

5 files changed

Lines changed: 109 additions & 1 deletion

File tree

β€Ždocs-mintlify/docs.jsonβ€Ž

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -437,6 +437,7 @@
437437
"embedding/iframe/analytics-chat",
438438
"embedding/iframe/creator-mode",
439439
"embedding/iframe/customization",
440+
"embedding/iframe/localization",
440441
"embedding/iframe/events",
441442
{
442443
"group": "Authentication",

β€Ždocs-mintlify/embedding/iframe/customization.mdxβ€Ž

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ You can customize the appearance of iframe-embedded Cube content in two ways:
1212
Customization options will expand over time. This page documents what is supported today.
1313
</Note>
1414

15+
<Tip>
16+
To set the language of embedded surfaces β€” account-wide, per embed, or at runtime β€” see [Localization](/embedding/iframe/localization).
17+
</Tip>
18+
1519
<Tip>
1620
To brand the whole embedded experience β€” accent color, background, text, logo, and fonts β€” at the account level, configure the [app theme](/admin/customization/app-theme). It applies to all embedded surfaces automatically (and, optionally, to the entire Cube Cloud console).
1721
</Tip>

β€Ždocs-mintlify/embedding/iframe/dashboards.mdxβ€Ž

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,18 @@ CSV is generated client-side from the data already loaded into the widget, so no
8383
additional query is issued. The parameter is opt-in β€” omit it (the default) to
8484
keep the download action hidden.
8585

86+
## Set the language
87+
88+
Embedded dashboards render their UI in the account's default language, which you can
89+
override per embed by adding the `?locale=` query parameter:
90+
91+
```text
92+
https://your-tenant.cubecloud.dev/embed/dashboard/YOUR_DASHBOARD_PUBLIC_ID?session=YOUR_SESSION_ID&locale=es-MX
93+
```
94+
95+
See [Localization](/embedding/iframe/localization) for the list of supported languages
96+
and the other ways to set the language.
97+
8698
## Customize appearance
8799

88100
You can style an embedded dashboard β€” background, padding, widget borders, titles, and fonts β€” from the **Styling** panel in the Dashboard Builder. See [Dashboards β†’ Styling](/docs/explore-analyze/dashboards/styling) for the full list of options.

β€Ždocs-mintlify/embedding/iframe/events.mdxβ€Ž

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,8 @@ sendAction("cube:action:set-theme", {
348348
#### `cube:action:set-locale`
349349

350350
Switch the embed's UI language. Accepts a full code (`es-ES`), a short code
351-
(`es`), or a regional variant.
351+
(`es`), or a regional variant. See [Localization](/embedding/iframe/localization)
352+
for the list of supported languages and the other ways to set the language.
352353

353354
| Field | Type | Description |
354355
| --- | --- | --- |
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
---
2+
title: Localization
3+
description: Set the language for embedded Cube surfaces β€” account-wide, per embed via URL, or at runtime.
4+
---
5+
6+
Embedded Cube surfaces β€” dashboards, [Analytics Chat](/embedding/iframe/analytics-chat),
7+
and the full app in [Creator Mode](/embedding/iframe/creator-mode) β€” can render their
8+
UI in any of the supported languages. You can set a default language for the whole
9+
account, override it per embed with a URL parameter, or switch it at runtime from the
10+
host page.
11+
12+
<Note>
13+
Available on [Premium and Enterprise plans](https://cube.dev/pricing).
14+
</Note>
15+
16+
## Supported languages
17+
18+
| Language | Locale code |
19+
| -------------------------- | ----------- |
20+
| English (US) | `en-US` |
21+
| Deutsch (Deutschland) | `de-DE` |
22+
| EspaΓ±ol (EspaΓ±a) | `es-ES` |
23+
| EspaΓ±ol (LatinoamΓ©rica) | `es-MX` |
24+
| FranΓ§ais (France) | `fr-FR` |
25+
| Italiano (Italia) | `it-IT` |
26+
| ζ—₯本θͺž (ζ—₯本) | `ja-JP` |
27+
| Norsk bokmΓ₯l (Norge) | `nb-NO` |
28+
| PortuguΓͺs (Brasil) | `pt-BR` |
29+
| PortuguΓͺs (Portugal) | `pt-PT` |
30+
| Svenska (Sverige) | `sv-SE` |
31+
| TiαΊΏng Việt (Việt Nam) | `vi-VN` |
32+
33+
English (`en-US`) is the default and the fallback when no language is configured.
34+
35+
A locale value can be a full code (`es-ES`), a short language code (`es`), or a regional
36+
variant that isn't shipped (`es-AR`). Short codes and unsupported regional variants
37+
resolve to the first supported locale for that language β€” for example, both `es` and
38+
`es-AR` resolve to `es-ES`. A value that doesn't match any supported language is ignored.
39+
40+
## How the language is resolved
41+
42+
The language of an embedded surface is resolved from the following sources, highest
43+
priority first:
44+
45+
1. **Runtime override** β€” a [`cube:action:set-locale`](/embedding/iframe/events#cube-action-set-locale)
46+
message sent from the host page (see [At runtime](#at-runtime)).
47+
2. **URL parameter** β€” the `?locale=` query parameter on the embed URL (see
48+
[Per embed via URL](#per-embed-via-url)).
49+
3. **Account default** β€” the language configured in **Embed β†’ Settings** (see
50+
[Account-wide default](#account-wide-default)).
51+
4. **Fallback** β€” `en-US`.
52+
53+
## Account-wide default
54+
55+
Set a default language for all embedded surfaces from the Cube Cloud console:
56+
57+
1. Go to **Embed β†’ Settings**.
58+
2. In the **Language** card, pick a language from the dropdown.
59+
60+
The selected language applies to every embedded surface across the account, unless a
61+
specific embed overrides it with a `?locale=` URL parameter or a runtime
62+
`cube:action:set-locale` message.
63+
64+
Clearing the setting removes the stored default, and embeds fall back to `en-US` (or to
65+
whatever a per-embed override specifies).
66+
67+
## Per embed via URL
68+
69+
Override the account default for an individual embed by adding the `?locale=` query
70+
parameter to the embed URL:
71+
72+
```text
73+
https://your-tenant.cubecloud.dev/embed/dashboard/YOUR_DASHBOARD_PUBLIC_ID?session=YOUR_SESSION_ID&locale=es-MX
74+
```
75+
76+
The parameter is read once when the embed loads and pinned for the session, so in-app
77+
navigation won't drop it.
78+
79+
## At runtime
80+
81+
Switch the language after the embed has loaded by sending a
82+
[`cube:action:set-locale`](/embedding/iframe/events#cube-action-set-locale) message from
83+
the host page. This takes precedence over both the URL parameter and the account default:
84+
85+
```js
86+
sendAction("cube:action:set-locale", { locale: "es" });
87+
```
88+
89+
See [Events and actions](/embedding/iframe/events) for the full host ↔ embed messaging
90+
contract.

0 commit comments

Comments
Β (0)