This guide will walk you through setting up your first translation project with Gleef CLI in just a few minutes.

Prerequisites

Before starting, make sure you have:

Step-by-Step Setup

1

Navigate to your project

Open your terminal and navigate to your project directory:
cd /path/to/your/project
2

Initialize Gleef

Run the initialization command to set up Gleef in your project:
gleef init
This command will:
  • Prompt you to enter your locale file pattern using {locale} placeholder
  • Validate the pattern by loading your existing files
  • Map file/folder names to company locales if needed
  • Create a .gleef/config.json configuration file

Common Patterns by Technology

Here are typical patterns you might enter based on your stack:
public/locales/{locale}.json
# or for namespaced:
src/locales/{locale}/{feature}.json
Always use the {locale} placeholder in your pattern - it’s required for proper locale detection.
3

Complete the setup

After entering your pattern and mapping any locales, you’ll see output like:
 One pattern added successfully. You can add more in your config file.
src/locales/{locale}.json
Run `gleef translate` to start translating
To customize nested/flat output per format, edit the formatOptions in .gleef/config.json
Check the generated .gleef/config.json file to verify the configuration matches your project structure.
4

Push your first translations

Upload your existing translation keys to Gleef for AI translation:
gleef push --skip-review
This will:
  • Analyze your local translation files
  • Send new keys to Gleef for AI translation
  • Publish all translations without asking your team for review (similar to an initial commit)
You’ll see progress output like:
Processing 15 new translations
✔ Your files were translated successfully. Your team can review them from Gleef Studio.
5

Pull translated content

After translations are reviewed and approved in Gleef Studio, sync them back:
gleef pull
This updates your local files with the latest approved translations.

Example Project Structure

Here’s an example of how Gleef CLI works with a typical project structure:
my-app/
├── src/
│   └── locales/
│       ├── en-US.json
│       ├── fr-FR.json
│       └── es-ES.json
├── .gleef/
│   └── config.json
└── .gitignore
Before initialization: Only the locale files exist After gleef init: Configuration is created After gleef translate: Keys are sent to Gleef for translation After gleef pull: Local files are updated with new translations

Configuration File Example

After running gleef init, you’ll have a .gleef/config.json file like this:
{
  "localeFilePatterns": [
    "src/locales/{locale}.json"
  ],
  "formatOptions": {
    "json": {
      "nested": true
    }
  },
  "customLocaleNames": {
    "en-US": "english",
    "fr-FR": "french"
  }
}
The configuration includes:
  • localeFilePatterns: Your pattern with {locale} placeholder
  • formatOptions: Auto-detected based on your file types
  • customLocaleNames: Only added if your files don’t match standard locale names

Common Workflows

All commands can be added to your CI/CD or build scripts to automate updating or creating translations.

Adding New Translation Keys

  1. Add new keys to your base language file (e.g., en-US.json)
  2. Run gleef translate to send them for translation
  3. Review translations in Gleef Studio
  4. Run gleef pull to sync approved translations

Updating Existing Translations

  1. Modify existing keys in your local files
  2. Run gleef translate to update the translations
  3. Review changes in Gleef Studio
  4. Run gleef pull --all to sync all updates

Working with Multiple Developers

  1. Each developer runs gleef pull before starting work
  2. Make translation changes locally
  3. Run gleef translate to push changes
  4. Coordinate reviews in Gleef Studio
  5. Run gleef pull to get the latest approved translations

Next Steps