Skip to content

The easy-to-use open source Business Intelligence and Embedded Analytics tool that lets everyone work with data :bar_chart:

docs - fix translation docs (#68011)

Jeff Bruemmer1c9de4183218
diff --git a/docs/embedding/components.md b/docs/embedding/components.md
index 5faf461c9da..ab2f9fe9ead 100644
--- a/docs/embedding/components.md
+++ b/docs/embedding/components.md
@@ -36,7 +36,8 @@ To render a dashboard:
- `with-subscriptions` - let people set up [dashboard subscriptions](../dashboards/subscriptions.md). Unlike subscriptions sent from non-embedded dashboards, subscriptions sent from embedded dashboards exclude links to Metabase items, as Metabase assumes the recipient lacks access to the embedded Metabase.
- `refresh` - auto-refreshes the dashboard. `refresh="60"` will refresh the dashboard every 60 seconds.
- `hidden-parameters` - list of filter names to hide from the dashboard, like `['productId']`
-- `locale` - see [translations](./translations.md) (only available for guest embeds).
+
+For guest embeds, you can also set a `locale` in your page-level configuration to [translate embedded content](./translations.md).
Only `with-title` and `with-downloads` are supported in [guest embeds](./guest-embedding.md).
diff --git a/docs/embedding/guest-embedding.md b/docs/embedding/guest-embedding.md
index 10e8d6e9c4e..7226a160d1e 100644
--- a/docs/embedding/guest-embedding.md
+++ b/docs/embedding/guest-embedding.md
@@ -148,7 +148,19 @@ You can propagate filter values into the external URL, unless the filter is lock
## Translating guest embeds
-See [Translating embedded questions and dashboards](./translations.md).
+To translate an embed, set the `locale` in `window.metabaseConfig`:
+
+```html
+<script>
+ window.metabaseConfig = {
+ isGuest: true,
+ instanceUrl: "YOUR_METABASE_URL",
+ locale: "es",
+ };
+</script>
+```
+
+The `locale` setting works for all modular embeds (guest and SSO). Metabase will automatically translate UI elements (like menus and buttons). To also translate content like dashboard titles and filter labels, you'll need to upload a translation dictionary. Translation dictionaries only work with guest embeds. See [Translating embedded questions and dashboards](./translations.md).
## How guest embedding works
diff --git a/docs/embedding/translations.md b/docs/embedding/translations.md
index 915791188a0..0dae944ebb9 100644
--- a/docs/embedding/translations.md
+++ b/docs/embedding/translations.md
@@ -1,15 +1,49 @@
---
title: Translate embedded dashboards and questions
-summary: Upload a translation dictionary to translate questions and dashboards into different languages. Only available for guest embeds.
+summary: Upload a translation dictionary to translate questions and dashboards into different languages. Translation dictionaries are only available for guest embeds.
---
# Translate embedded dashboards and questions
{% include plans-blockquote.html feature="Translation of embedded content" convert_pro_link_to_embbedding=true %}
-For now, translations are only available for [guest embeds](./guest-embedding.md). Translations aren't available for SSO-based modular embedding or full app embedding.
+You can set a locale on all modular embeds (guest and SSO) to translate Metabase's UI. Translation dictionaries, however, are only available for [guest embeds](./guest-embedding.md).
-You can upload a translation dictionary to translate strings both in Metabase content (like dashboard titles) and in the data itself (like column names and values).
+## Set a locale to translate UI, and upload a dictionary to translate content
+
+To translate an embed's user interface, set the locale in the config. The `locale` setting works for all modular embeds (guest and SSO). Metabase UI elements (like menus) will be translated automatically - you don't need to add translations for them to your dictionary.
+
+For guest and SSO embeds (not the SDK), set the `locale` in `window.metabaseConfig`:
+
+```html
+<script>
+ window.metabaseConfig = {
+ isGuest: true,
+ instanceUrl: "YOUR_METABASE_URL",
+ // Translates UI elements to the locale's language.
+ // For guest embeds, if you've uploaded a translation dictionary,
+ // Metabase will also translate content strings
+ // to this locale from that dictionary.
+ locale: "es"
+ };
+</script>
+
+<metabase-dashboard token="YOUR_JWT_TOKEN"></metabase-dashboard>
+```
+
+For guest embeds (and only guest embeds), if you also want to translate content (like item titles, headings, filter labels---even data), you'll need to add a translation dictionary.
+
+### SDK translations
+
+For the SDK, set the `locale` prop on the `MetabaseProvider` component:
+
+```tsx
+<MetabaseProvider
+ authConfig={authConfig}
+ locale="es"
+>
+</MetabaseProvider>
+```
## Add a translation dictionary
@@ -30,21 +64,6 @@ Uploading a new dictionary will replace the existing dictionary.
To remove a translation dictionary, upload a blank dictionary.
-## Translate content in guest embeds
-
-To translate content in a guest embed using the uploaded dictionary, add the [`locale` parameter](./components.md).
-```
- <metabase-dashboard
- dashboard-id="1"
- with-title="false"
- with-subscriptions="true"
- drills="true"
- locale="es"
- </metabase-dashboard>
-```
-
-Metabase UI elements (like button labels) will be translated automatically - you don't need to add translations for them to your dictionary.
-
## Example translation dictionary
Metabase uses these dictionaries to translate user-generated content, like dashboard names in [guest embeds](./guest-embedding.md).