docs(site): update media text examples

This commit is contained in:
Sam Potts
2026-07-13 08:22:40 +10:00
parent 8bbe640a15
commit c8e1bd81e5
3 changed files with 7 additions and 9 deletions
@@ -59,7 +59,7 @@ Use <DocsLink slug="reference/media-text">`<media-text>`</DocsLink> for static c
```html
<media-i18n lang="es">
<media-text key="Play"></media-text>
<media-text>Play</media-text>
</media-i18n>
```
@@ -22,7 +22,7 @@ Register locale strings with <DocsLink slug="reference/register-i18n">`registerI
</script>
<media-i18n lang="es">
<media-text key="Play"></media-text>
<media-text>Play</media-text>
</media-i18n>
```
@@ -34,7 +34,7 @@ Register locale strings with <DocsLink slug="reference/register-i18n">`registerI
## Related
- <DocsLink slug="reference/media-text">`<media-text>`</DocsLink> — renders a translated string by key
- <DocsLink slug="reference/media-text">`<media-text>`</DocsLink> — renders translated text content
- <DocsLink slug="how-to/i18n-register-locale">Register a custom locale</DocsLink>
</FrameworkCase>
@@ -8,19 +8,17 @@ import FrameworkCase from "@/components/docs/FrameworkCase.astro";
<FrameworkCase frameworks={["html"]}>
`<media-text>` renders the translated value for a registry phrase inside a <DocsLink slug="reference/media-i18n">`<media-i18n>`</DocsLink> (or any ancestor with the i18n provider mixin). Use it for standalone labels, tooltips, or demos — skin controls resolve phrases internally.
`<media-text>` renders the translated value for its text content inside a <DocsLink slug="reference/media-i18n">`<media-i18n>`</DocsLink> (or any ancestor with the i18n provider mixin). Use it for standalone labels, tooltips, or demos — skin controls resolve phrases internally.
```html
<media-i18n lang="ja">
<media-text key="Play"></media-text>
<media-text>Play</media-text>
</media-i18n>
```
## Attributes
## Text content
| Attribute | Description |
| --- | --- |
| `key` | English translation phrase (`Play`, `Pause`, `{duration} remaining`, …). |
The initial text content is the English translation phrase (`Play`, `Pause`, `{duration} remaining`, …). If the phrase is not registered for the active locale, `<media-text>` keeps the original text.
Parametric phrases are not yet supported on `<media-text>` — use `createTranslator` in script for interpolated strings.