Skip to main content
XML localization files store text within structured elements. Hyperlocalise uses a generic XML parser for supported text-only leaves. Android resources, XLIFF, and Apple plist formats have separate parsers and guides. Supported extensions: .xml.

Source file

Save this example as locales/en-US/messages.xml.

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.

Behavior and limitations

  • Text-only leaves use key, id, or name attributes as keys. Unkeyed nested leaves use dotted element paths.
  • Comments, attributes, and metadata elements are retained. Matching root locale attributes are updated for the target locale.
  • Mixed-content values and Android, XLIFF, or plist roots are rejected by this parser. Use their dedicated formats.
  • CDATA is readable, but changed values are written as escaped XML text. Whitespace inside values may change with translated text.

Next steps