.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: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 | Description | Example |
|---|---|---|
{locale} | Required - Locale identifier | en, fr-FR, es-ES |
{feature} | Optional - Feature/namespace name | common, auth, dashboard |
{namespace} | Optional - Alternative to feature | header, footer, modal |
| Pattern | Matches | Structure |
|---|---|---|
src/{locale}.json | src/en.json, src/fr.json | Simple structure |
locales/{locale}/{feature}.json | locales/en/common.json, locales/fr/auth.json | Locale-first namespacing |
i18n/{feature}.{locale}.json | i18n/common.en.json, i18n/auth.fr.json | Feature-first namespacing |
assets/{locale}/strings.xml | assets/en/strings.xml, assets/fr/strings.xml | Folder-based locales |
formatOptions
Type:objectRequired: No Controls how different file formats are processed and generated.
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
NonecustomLocaleNames
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.
- Legacy naming conventions that can’t be changed
- Simplified locale names (
frinstead offr-FR) - Descriptive filenames in existing projects
- Platform-specific naming requirements (iOS:
en.lproj)
- Company locale
"fr-FR"maps to file/folder name"french" - Pattern
src/{locale}.jsonresolves tosrc/french.json - Gleef treats this file as containing
fr-FRtranslations
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.
prependNamespaceToKeys (default):
- Both files have key
loginButton - Conflict: Remote storage can’t distinguish between them
prependNamespaceToKeys: true:
auth.json→ Remote key:auth.loginButtoncommon.json→ Remote key:common.loginButton- No conflict: Keys are unique remotely
- 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
- Keys are only transformed for remote storage - local files remain unchanged
- When pulling translations, namespace prefixes are automatically stripped
- Works seamlessly with the
--namespaceflag for filtering
Advanced Configuration Examples
Multi-Module Project
Cross-Platform Project
Namespace-Organized Project
Namespace Project with Key Prepending
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:Flat JSON
Configuration:XML Structure
Configuration:Configuration Validation
Common Validation Errors
Missing Locale Placeholder:Troubleshooting
Configuration Issues
No files detected:- Check pattern syntax
- Verify file paths are correct
- Test patterns with file system tools
- Add exclusion patterns
- Make patterns more specific
- Check for conflicting patterns
- Validate JSON syntax
- Check property names and values
- Review format-specific options