Skip to main content
The .gleef/config.json file controls how Gleef CLI processes your localization files. This file is created automatically by gleef init but can be customized for complex project setups.

Configuration Location

The configuration file is always located at:
This file should be committed to version control so your team shares the same configuration.

Basic Configuration Structure

Configuration Properties

localeFilePatterns

Type: string[]
Required: Yes
Defines placeholder patterns that match your localization files. Each pattern must include the {locale} placeholder.
Placeholder Syntax: Pattern Examples:

formatOptions

Type: object
Required: No
Controls how different file formats are processed and generated.
Format-Specific Options:

JSON Options

  • nested (boolean): Use nested object structure vs flat keys

XML Options

  • nested (boolean): Use nested elements vs flat structure

YAML Options

  • nested (boolean): Use nested structure vs flat keys

Strings Options

None

customLocaleNames

Type: object Required: No Maps your company’s locale codes to the actual file or folder names in your project when they don’t match.
Use Cases:
  • Legacy naming conventions that can’t be changed
  • Simplified locale names (fr instead of fr-FR)
  • Descriptive filenames in existing projects
  • Platform-specific naming requirements (iOS: en.lproj)
How it works:
  • Company locale "fr-FR" maps to file/folder name "french"
  • Pattern src/{locale}.json resolves to src/french.json
  • Gleef treats this file as containing fr-FR translations

prependNamespaceToKeys

Type: boolean Required: No Default: false Automatically prepends the namespace/file name to translation keys when pushing to Gleef’s remote storage. This is useful when you have multiple namespace files per locale and want to keep keys unique across files remotely while maintaining simple keys locally.
How it works: When enabled, translation keys are transformed before being sent to Gleef: Local file structure:
Without prependNamespaceToKeys (default):
  • Both files have key loginButton
  • Conflict: Remote storage can’t distinguish between them
With prependNamespaceToKeys: true:
  • auth.json → Remote key: auth.loginButton
  • common.json → Remote key: common.loginButton
  • No conflict: Keys are unique remotely
Use Cases:
  • Projects with multiple namespace files per locale
  • Preventing key naming conflicts across different feature files
  • Maintaining simple local key names while having unique remote keys
  • Working with modular translation architectures
Important:
  • Keys are only transformed for remote storage - local files remain unchanged
  • When pulling translations, namespace prefixes are automatically stripped
  • Works seamlessly with the --namespace flag for filtering

placeholderTransformation

Type: string | "default" | "none" Required: No Default: "none" (transformation disabled) Automatically converts placeholders between platform-specific formats and Gleef’s universal ICU MessageFormat. This enables seamless cross-platform development where different platforms use different placeholder syntaxes.
Configuration Options: Default Format Mappings: When using "default", file extensions automatically determine the format: How it works: Gleef stores all translations using ICU MessageFormat internally. When you push/pull:
  • Push: Converts your platform format → ICU format for remote storage
  • Pull: Converts ICU format → your platform format for local files
Platform Format Examples:
Use Cases: Cross-Platform Projects:
With this configuration:
  • Web JSON files use {userName} syntax (ICU)
  • iOS strings use %@ syntax (iOS format)
  • Android XML uses %s syntax (Android format)
  • All convert to ICU when stored in Gleef
  • Each pulls back in its native format
Forcing a Specific Format:
This forces JSON files to use Android placeholder syntax (%s, %d) instead of the default ICU format. Type Annotations: Placeholders can include type information for better validation: Positional Arguments: Reorder placeholders in translations using positional markers: Important Notes:
  • Transformation happens automatically during push/pull operations
  • Local files always maintain their native platform format
  • Translators see the universal ICU format in Gleef’s platform
  • Conversion is deterministic and reversible

Advanced Configuration Examples

Multi-Module Project

Cross-Platform Project

Namespace-Organized Project

Namespace Project with Key Prepending

This configuration solves the duplicate key problem where loginButton appears in both auth.json and common.json. With prependNamespaceToKeys: true, they become unique remote keys: auth.loginButton and common.loginButton.

File Structure Examples

Nested JSON (Default)

Configuration:
Output:

Flat JSON

Configuration:
Output:

XML Structure

Configuration:
Output:

Configuration Validation

Common Validation Errors

Missing Locale Placeholder:
No Files Matched:
Invalid Pattern Syntax:
Locale Mapping Issues:

Troubleshooting

Configuration Issues

No files detected:
  • Check pattern syntax
  • Verify file paths are correct
  • Test patterns with file system tools
Wrong files included:
  • Add exclusion patterns
  • Make patterns more specific
  • Check for conflicting patterns
Format errors:
  • Validate JSON syntax
  • Check property names and values
  • Review format-specific options

Recovery

Reset configuration:

Next Steps

File Patterns

Learn advanced file pattern matching techniques

Format Options

Master format-specific configuration options