Skip to main content
The gleef pull command downloads the latest approved translations from Gleef and updates your local localization files.

Usage

Options

What it does

The pull command:
  1. Fetches remote state - Gets the latest translations from Gleef
  2. Compares changes - Identifies modified and new translations
  3. Shows preview - Displays what will be updated (unless using --check)
  4. Updates files - Applies changes to your local localization files

Basic Usage

Pull Updates Only

This updates existing keys with new translations but doesn’t add new keys.

Add New Translations

This updates existing keys AND adds new translation keys that were created remotely.

Filter by Key Pattern

Only pulls keys matching the pattern. The pattern is a JavaScript regular expression tested against each key (unanchored), with a fallback to a plain substring check if the pattern isn’t valid regex.
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. Use \.title$ to match keys ending with .title.

Filter by Namespace

Only pulls translations from files matching the namespace pattern. Useful for projects with multiple namespace/feature files.

Check for Updates

This checks if updates are available without applying them. Useful for CI/CD to verify translation status.

Example Output

Updates Available

New Keys Available (with —add-new)

Nothing to Update

Check Mode

The —add-new Flag

By default, pull only updates existing keys. Use --add-new to also add new keys:

Without —add-new (default)

  • ✅ Updates existing translation values
  • ❌ Ignores new keys created remotely
  • ✅ Safe for stable releases

With —add-new

  • ✅ Updates existing translation values
  • ✅ Adds new keys created remotely
  • ⚠️ May require code changes to handle new keys

Filtering Options

Pattern Matching with —add-new

When using --add-new, you can filter which new keys to add:

Namespace Filtering

Filter translations by namespace/file pattern. This is useful when you have multiple namespaced files per locale:
Example Use Case: If your project structure is:
You can pull updates for just the auth namespace:

Multiple File Namespaces

If your project has multiple files per locale, you’ll be prompted to choose where new keys should be added:
This ensures new keys are added to the correct files based on your project structure.

Conflict Prevention

The pull command is designed to be safe:
  1. Shows preview - Always shows what will change before applying
  2. Requires confirmation - Asks before overwriting local changes
  3. Preserves formatting - Maintains your file structure and indentation
  4. Atomic updates - Either all changes apply or none do

Examples

Feature Integration

Namespace-Specific Updates

Release Preparation (No CI)

CI/CD Integration

Error Handling

Common Errors

No Changes Error:
This is normal - no action needed Network Error:
Solution: Check internet connection and try again File Permission Error:
Solution: Check file permissions and ensure files aren’t locked Configuration Error:
Solution: Run gleef init or check your .gleef/config.json

Troubleshooting

Large Number of Changes

If you see many unexpected changes:
  1. Check recent activity - Review what happened in Gleef Studio
  2. Use patterns - Pull specific sections with --match
  3. Coordinate with team - Ensure you’re not missing context

Missing Translations

If expected translations aren’t appearing:
  1. Use —add-new flag - New keys require the --add-new flag
  2. Check patterns - Ensure your --match pattern is correct
  3. Verify approval - Translations must be approved in Gleef Studio

File Conflicts

If you have local changes that conflict:
  1. Commit local changes - Save your work before pulling
  2. Review differences - Understand what changed remotely
  3. Merge carefully - Decide which version to keep

Integration Examples

NPM Scripts

Git Hooks

GitHub Actions

Next Steps

After pulling translations:

Push Changes

Send your new translation keys to Gleef

Configuration

Customize how files are processed