Skip to main content
JSON stores messages as key-value data and is commonly used by web application localization libraries. Hyperlocalise translates string values in supported JSON catalogs; keep application settings separate from translation files. Supported extensions: .json.

Source file

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

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

  • Nested objects use dotted keys such as home.title; arrays use indexed paths. Translation leaves must be strings.
  • Numbers, booleans, and other non-string leaves are rejected. Keep application settings separate from locale messages.
  • Output preserves the JSON data structure, but indentation and object ordering may change.
  • Strict FormatJS catalogs are detected automatically: defaultMessage is translated and description supplies context. See FormatJS.

Next steps