Initialize Gleef in your project by detecting locale files and creating configuration
gleef init
command sets up Gleef in your project by guiding you through the configuration process and creating the necessary configuration file.
init
command performs several important setup tasks:
{locale}
, {feature}
).gleef/config.json
with proper format options{locale}
- Required placeholder for the locale identifier{feature}
or {namespace}
- Optional placeholders for organizing translations.json
- JSON localization files.xml
- XML localization files.yaml
/ .yml
- YAML localization files.strings
- iOS strings filesPattern | Matches | Use Case |
---|---|---|
src/locales/{locale}.json | src/locales/en.json , src/locales/fr.json | Simple locale files |
public/i18n/{locale}/{feature}.json | public/i18n/en/common.json , public/i18n/fr/auth.json | Namespaced translations |
locales/{feature}.{locale}.json | locales/common.en.json , locales/auth.fr.json | Feature-first organization |
init
, you’ll find a .gleef/config.json
file in your project:
Property | Description |
---|---|
localeFilePatterns | Placeholder patterns matching your localization files using {locale} syntax |
formatOptions | Output format settings for each file type (auto-detected based on your patterns) |
customLocaleNames | Maps company locale codes to your file/folder names when they don’t match |
{locale}
placeholder - All patterns must include {locale}
.json
, .xml
, .yaml
, or .strings
/
in patterns{locale}
placeholder in your file patterns for proper locale detection.src/i18n/{locale}/{feature}.json
{feature}
placeholders for organized translations.gleef/config.json
matches your expectations.gleef/config.json
to version control