Skip to main content
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.

Configure your files

Use this i18n.yml for the example, or add its file mapping to your existing bucket. See path templates for other layouts.

Translate

Install the CLI and set OPENAI_API_KEY in your project’s .env.local or shell. You can also configure another AI provider.
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.

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