> ## Documentation Index
> Fetch the complete documentation index at: https://hyperlocalise.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Translate SVG text with Hyperlocalise

> Translate visible SVG text, titles, and descriptions while preserving markup and geometry.

SVG files can contain visible labels as well as geometry. Hyperlocalise extracts text from supported elements and writes translations back into the same markup. Review the rendered graphic after translation.

Supported extensions: `.svg`.

## Source file

Save this example as `locales/en-US/messages.svg`.

```xml theme={null}
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 120 40">
    <title>Product mark</title>
    <text x="8" y="24">Hello <tspan font-weight="700">world</tspan>!</text>
</svg>
```

## Configure your files

Use this `i18n.yml` for the example, or add its file mapping to your existing bucket.
See [path templates](/cli/configuration/path-templates) for other layouts.

```yaml theme={null}
locales:
    source: en-US
    targets:
        - es-ES

buckets:
    messages:
        files:
            - from: locales/en-US/messages.svg
              to: locales/{{target}}/messages.svg

llm:
    profiles:
        default:
            provider: openai
            model: gpt-5.2
```

## Translate

[Install the CLI](/cli/getting-started/install) and set `OPENAI_API_KEY` in your
project's `.env.local` or shell. You can also configure another
[AI provider](/cli/providers/overview).

```bash theme={null}
hyperlocalise run --dry-run
hyperlocalise run
```

The dry run previews the work. The second command writes translations to the
configured target path and updates the lockfile.

Hyperlocalise Platform native projects also accept `.svg` uploads for file
translation jobs and segment review. SVG is treated as a text catalog, not as a
raster image. See [Supported formats](/platform/file-formats).

## Behavior and limitations

* Translatable text comes from `text`, `tspan`, `textPath`, `title`, and `desc`. Each span is a sequential key such as `svg.0001`.

* Geometry, attributes, and markup stay in the file. `style`, `script`, and `metadata` content is skipped.

* Writeback replaces extracted spans and HTML-escapes translated text. Extra keys are ignored so markup stays aligned with the template.

* Longer translations can overflow the original layout. Review the rendered SVG after translation.

## Next steps

* [Check translations](/cli/commands/check) before committing generated files.
* [Local translation workflow](/cli/workflows/local-generation) explains repeat runs.
* [Browse all file formats](/cli/reference/formats/overview).

## Related formats

* [HTML](/cli/reference/formats/html)
* [XML localization](/cli/reference/formats/xml)
* [Lottie animation text](/cli/reference/formats/lottie)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.