Configuration
LocaleKit is configured via a .localekitrc.yml file in your project root. Create one with localekit init or manually.
The CLI auto-discovers .localekitrc.yml, .localekitrc.yaml, or .localekitrc by searching the current and parent directories.
Example
yaml
# LocaleKit CLI Configuration
# Copy this file to your project root as .localekitrc.yml
# =============================================================================
# PATHS
# =============================================================================
# Workspace/project directory to scan
workspace: ./
# Direct file paths (alternative to workspace scanning)
# Useful for targeting specific localization files
# files:
# - ./MyApp/Localizable.xcstrings
# - ./OtherModule/strings.xml
# =============================================================================
# LANGUAGES
# =============================================================================
# Source/base language for translations
sourceLanguage: en-US
# Target languages to translate to
# See /cli/languages for full list of supported codes
targetLanguages:
- de-DE # German (Germany)
- fr-FR # French (France)
- es-ES # Spanish (Spain)
- ja-JP # Japanese
- zh-CN # Chinese (Simplified)
# - pt-BR # Portuguese (Brazil)
# - it-IT # Italian
# - ko-KR # Korean
# - nl-NL # Dutch
# - pl-PL # Polish
# - ru-RU # Russian
# =============================================================================
# TRANSLATION ENGINE
# =============================================================================
engine: deepl
# API keys for translation services
# For security, use environment variable syntax: ${ENV_VAR_NAME}
#
# Option 1: Use separate keys for each service (recommended)
deeplApiKey: ${DEEPL_API_KEY}
openaiApiKey: ${OPENAI_API_KEY}
#
# =============================================================================
# OPTIONS
# =============================================================================
# Show detailed output during operations
verbose: false
# Preview changes without writing files
# Useful for testing translation before applying
dryRun: falseReference
| Field | Type | Description | Default |
|---|---|---|---|
workspace | string | Project directory to scan | . |
files | string[] | Direct file paths (alternative to workspace scanning) | — |
sourceLanguage | string | Base language (BCP 47). See supported languages. | en-US |
targetLanguages | string[] | Target languages to translate to | — |
engine | string | Translation engine: deepl, openai, mlx | deepl |
deeplApiKey | string | DeepL API key (supports ${ENV_VAR}) | — |
openaiApiKey | string | OpenAI API key (supports ${ENV_VAR}) | — |
mlxModel | string | MLX model ID from Hugging Face | mlx-community/Qwen3-4B-4bit |
verbose | bool | Show detailed output | false |
dryRun | bool | Preview without writing files | false |
github.repo | string | Repository in owner/repo format | — |
github.baseBranch | string | Base branch for PRs | main |
github.token | string | GitHub token (or use GITHUB_TOKEN env) | — |
Environment Variables
| Variable | Used By | Description |
|---|---|---|
DEEPL_API_KEY | translate, sync | DeepL API key |
OPENAI_API_KEY | translate, sync | OpenAI API key |
GITHUB_TOKEN | sync | GitHub personal access token |
Add to your shell profile (~/.zshrc or ~/.bashrc):
bash
export DEEPL_API_KEY="your-deepl-api-key"bash
export OPENAI_API_KEY="your-openai-api-key"bash
export GITHUB_TOKEN="your-github-token"Shell Completions
Homebrew installs completions automatically. For manual installs:
bash
localekit --generate-completion-script zsh > ~/.zsh/completions/_localekitbash
localekit --generate-completion-script bash > /etc/bash_completion.d/localekitbash
localekit --generate-completion-script fish > ~/.config/fish/completions/localekit.fishExit Codes
| Code | Meaning |
|---|---|
0 | Success |
1 | Validation error, auth failure, or warnings in strict mode |
2 | Invalid command-line arguments |
