# Translating Components

> Override built-in strings per instance or globally with the i18n attribute and the z-i18n script.

Every component with text ships built-in English defaults. Override them per instance with `i18n="key: text; key: text"`, using the keys listed on the component page.

```html
<z-calendar
  lang="fr"
  i18n="prev-month: Mois précédent; next-month: Mois suivant; select-month: Choisir le mois"
  value="2026-11-29"
></z-calendar>
```

For site-wide translations, declare a global JSON script once. Keys can be flat or grouped under a component name.

```html
<script id="z-i18n" type="application/json">
  {
    "prev-month": "Mois précédent",
    "next-month": "Mois suivant",
    "z-cmd": {
      "search-placeholder": "Rechercher…",
      "empty-message": "Aucun résultat."
    }
  }
</script>
```

> **Note:** Resolution order: instance `i18n` attribute, then the global `z-i18n` script, then the built-in defaults.
