Skip to main content
This guide uses OpenAI and one JSON file. You need the CLI installed and an OpenAI API key. For another setup, choose an AI provider or a file format.
Working with a team? Connect the CLI to Hyperlocalise Platform to share source files, manage translation and review in a workspace, and pull project translations back into your repository. This guide covers standalone local translation.

1. Create a source file

From your project directory, create locales/en-US.json:

2. Configure the project

Create i18n.yml in the project root:
A bucket groups related source-to-target file mappings. This one reads locales/en-US.json and writes locales/es-ES.json. For an existing project, you can also use hyperlocalise init to scaffold a configuration, then adjust its file paths and provider.

3. Add your API key

Add the key to .env.local in the project root:
Keep this file out of version control. The CLI reads .env and .env.local automatically; exported shell variables take precedence. See provider credentials for other providers.

4. Preview and translate

Preview the work:
Check that the plan includes your source file and Spanish target. Then generate:
The CLI creates locales/es-ES.json and records progress in .hyperlocalise.lock.json. Translated wording can vary by model; the keys and {name} placeholder should remain intact.

5. Review the result

Open the generated file and review the diff. Check translation integrity and inspect progress:
Commit the source, configuration, translated file, and lockfile after review. When source messages change, repeat the preview and translation commands.

Continue