Prerequisites
Before starting, make sure you have:- Installed Gleef CLI
- Authenticated with your API key
- A project with existing localization files (JSON, XML, YAML, or .strings)
Step-by-Step Setup
1
Navigate to your project
Open your terminal and navigate to your project directory:
2
Initialize Gleef
Run the initialization command to set up Gleef in your project: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: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: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: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)
5
Pull translated content
After translations are reviewed and approved in Gleef Studio, sync them back: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: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 runninggleef init
, you’ll have a .gleef/config.json
file like this:
- 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
- Add new keys to your base language file (e.g.,
en-US.json
) - Run
gleef translate
to send them for translation - Review translations in Gleef Studio
- Run
gleef pull
to sync approved translations
Updating Existing Translations
- Modify existing keys in your local files
- Run
gleef translate
to update the translations - Review changes in Gleef Studio
- Run
gleef pull --all
to sync all updates
Working with Multiple Developers
- Each developer runs
gleef pull
before starting work - Make translation changes locally
- Run
gleef translate
to push changes - Coordinate reviews in Gleef Studio
- Run
gleef pull
to get the latest approved translations