TheDocumentation Index
Fetch the complete documentation index at: https://docs.gleef.eu/llms.txt
Use this file to discover all available pages before exploring further.
gleef translate command sends your new and modified keys to Gleef, generates AI translations for the missing locales, and writes the generated translations back into your local files in a single step.
For the standard workflow of uploading new and updated translations, use
gleef push. Use gleef translate only when you specifically want the generated translations merged into your local files immediately, rather than pulling them later.Usage
Options
| Flag | Short | Description |
|---|---|---|
--match | -m | Filter translations by key pattern |
--namespace | -n | Filter translations by namespace/file pattern (e.g., “auth” or “auth|common”) |
--skip-review | -s | Publish translations immediately instead of creating drafts |
What it does
Thetranslate command:
- Analyzes local files - Compares your local translations with remote state
- Detects changes - Identifies new keys and modified translations
- Handles conflicts - Checks for conflicts with remote edits
- Sends for translation - Uploads keys to Gleef’s AI translation service
- Updates local files - Merges generated translations back to your files
- Creates drafts - Sets up translations for team review (unless
--skip-reviewis used)
Basic Usage
Push All Changes
Filter by Key Pattern
Filter by Namespace
Skip Review Process
Example Output
Processing New Translations
Processing Mixed Changes
No Changes to Process
Pattern Matching
The--match flag accepts a JavaScript regular expression that is tested against each translation key. It is unanchored, so a pattern matches if it appears anywhere in the key. If the pattern isn’t valid regex, it falls back to a plain substring check.
This is regex, not a glob.
. matches any character and * means “zero or more of the previous character”, so a pattern like *.title is invalid regex and won’t behave like a glob.Common Patterns
Complex Patterns
Conflict Resolution
If there are conflicts with remotely edited translations, the command will stop and show details:Resolving Conflicts
- Update locally - Change your local value to match the remote
- Update remotely - Change the value in Gleef Studio
- Pull first - Run
gleef pullto get latest changes, then translate
Translation Process
New Keys
When you add new translation keys:translate command will:
- Detect the new keys
- Send them to Gleef AI for translation
- Generate translations in all your target languages
- Update your local files with the generated translations
Modified Keys
When you change existing translations:- Detect the modification
- Push the edited translation as draft or directly publish it
- Preserve translations in other languages
Review Workflow
Default Behavior (Draft Mode)
By default, translations are created as drafts for team review:- Translations generated - AI creates translations for all target languages
- Drafts created - Translations are marked as drafts in Gleef Studio, where you can ask for a review
- Team reviews - Your team can review and approve in Gleef Studio
- Pull approved - Use
gleef pullto sync approved translations
Skip Review Mode
With--skip-review, translations are published immediately:
- Automated workflows
- Non-critical translations
- When you trust the AI output completely
Examples
Development Workflow
Feature Development
Bulk Updates
Namespace-Specific Translation
Error Handling
Common Errors
Authentication Error:gleef login to re-authenticate
Configuration Error:
gleef init or check your .gleef/config.json
Network Error:
Best Practices
- Pull latest changes -
gleef pullto get recent updates - Use patterns for large translation jobs - Filter with
--matchfor focused updates - Review in Gleef Studio - Check AI translations quality and ask for a review there or publish
- Coordinate with team - Ensure reviewers know about pending translations
Integration Examples
Git Hooks
This hook would filter keys based on the committed file name, given that the new keys follow a precise naming convention.NPM Scripts
GitHub Actions
Next Steps
After pushing translations:Review in Studio
Review and approve translations in Gleef Studio
Pull Updates
Sync approved translations back to your project