Skip to content

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: false

Reference

FieldTypeDescriptionDefault
workspacestringProject directory to scan.
filesstring[]Direct file paths (alternative to workspace scanning)
sourceLanguagestringBase language (BCP 47). See supported languages.en-US
targetLanguagesstring[]Target languages to translate to
enginestringTranslation engine: deepl, openai, mlxdeepl
deeplApiKeystringDeepL API key (supports ${ENV_VAR})
openaiApiKeystringOpenAI API key (supports ${ENV_VAR})
mlxModelstringMLX model ID from Hugging Facemlx-community/Qwen3-4B-4bit
verboseboolShow detailed outputfalse
dryRunboolPreview without writing filesfalse
github.repostringRepository in owner/repo format
github.baseBranchstringBase branch for PRsmain
github.tokenstringGitHub token (or use GITHUB_TOKEN env)

Environment Variables

VariableUsed ByDescription
DEEPL_API_KEYtranslate, syncDeepL API key
OPENAI_API_KEYtranslate, syncOpenAI API key
GITHUB_TOKENsyncGitHub 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/_localekit
bash
localekit --generate-completion-script bash > /etc/bash_completion.d/localekit
bash
localekit --generate-completion-script fish > ~/.config/fish/completions/localekit.fish

Exit Codes

CodeMeaning
0Success
1Validation error, auth failure, or warnings in strict mode
2Invalid command-line arguments

LocaleKit CLI 0.7.2 · Built by Hexagone Studio