Internationalization (i18n) Guide
Spec Kit supports multiple languages for commands, templates, and CLI messages.
Supported Languages
- English (en): Default language, always included
- Korean (ko): Full translation available
Architecture
Spec Kit uses a hybrid i18n approach:
- Default language (English) is bundled with the main package
- Additional languages can be installed separately (feature coming soon)
- Language detection is automatic based on system locale or environment variables
Directory Structure
spec-mix/
├── locales/
│ ├── config.json # Language configuration
│ ├── en/ # English (default)
│ │ ├── strings.json # CLI messages
│ │ ├── commands/ # Command instructions
│ │ │ ├── specify.md
│ │ │ ├── plan.md
│ │ │ └── ...
│ │ └── templates/ # Document templates
│ │ ├── spec-template.md
│ │ ├── plan-template.md
│ │ └── ...
│ └── ko/ # Korean
│ ├── strings.json
│ ├── commands/
│ └── templates/
Using Spec Kit in Different Languages
Automatic Language Detection
Spec Kit automatically detects your language based on:
- SPECIFY_LANG environment variable (highest priority)
- System locale (LANG, LC_ALL)
- Default language (English) if none detected
Setting Language Manually
Option 1: Environment Variable (Recommended)
Add to your shell profile (~/.bashrc, ~/.zshrc, etc.):
export SPECIFY_LANG=ko
Option 2: Per-Session
SPECIFY_LANG=ko spec-mix init my-project
Option 3: Using the CLI
# List available languages
spec-mix lang list
# Show current language
spec-mix lang current
# Set default language (updates environment variable recommendation)
spec-mix lang set ko
Language Management Commands
spec-mix lang list
Lists all available and installed languages:
$ spec-mix lang list
Available Languages
┌──────────┬────────────────────────┬─────────────────────────┐
│ Code │ Name │ Status │
├──────────┼────────────────────────┼─────────────────────────┤
│ en │ English (English) │ Installed, Default │
│ ko │ 한국어 (Korean) │ Installed │
└──────────┴────────────────────────┴─────────────────────────┘
Current language: English (English)
spec-mix lang current
Shows the currently active language:
$ spec-mix lang current
Current language: 한국어 (Korean) (ko)
To change language:
spec-mix lang set <code>
To list available languages:
spec-mix lang list
spec-mix lang set <code>
Sets the default language and provides instructions for making it permanent:
$ spec-mix lang set ko
Default language set to: 한국어 (Korean)
To make this permanent, add to your shell profile:
export SPECIFY_LANG=ko
spec-mix lang install <code> (Coming Soon)
Installs a language pack from GitHub releases:
$ spec-mix lang install ko
Installing language pack: ko
Downloading from GitHub releases...
[Feature Coming Soon]
Language pack installation from GitHub releases is not yet implemented.
For now, language packs are bundled with the main package.
How Language Selection Works
Template and Command Loading
When you run a command like /spec-mix.specify:
- Spec Kit checks the current language setting
- Loads the appropriate command file from
locales/{lang}/commands/specify.md - Uses templates from
locales/{lang}/templates/ - Falls back to English if translation is missing
CLI Messages
All CLI messages (errors, success messages, prompts) are translated using the strings.json file:
# In Python code
from specmix.i18n import t
# Translate a message
message = t('cli.init.project_ready') # English: "Project ready."
# Korean: "프로젝트가 준비되었습니다."
# With format arguments
message = t('cli.init.error_invalid_ai', ai='claude', options='claude, copilot')
Adding a New Language
1. Create Language Directory
mkdir -p locales/{lang_code}/{commands,templates}
2. Add to Configuration
Edit locales/config.json:
{
"supported_locales": [
{
"code": "en",
"name": "English",
"native_name": "English",
"is_default": true
},
{
"code": "ja",
"name": "Japanese",
"native_name": "日本語",
"is_default": false
}
]
}
3. Translate Strings
Create locales/{lang_code}/strings.json with all CLI messages translated.
Use locales/en/strings.json as reference.
4. Translate Commands
Copy command files from locales/en/commands/ and translate:
specify.md- Feature specification workflowconstitution.md- Project constitution workflowplan.md- Implementation planning workflowtasks.md- Task breakdown workflowimplement.md- Implementation execution workflowclarify.md- Clarification workflowanalyze.md- Analysis workflowchecklist.md- Checklist generation workflow
5. Translate Templates
Copy template files from locales/en/templates/ and translate:
spec-template.md- Feature specification templateplan-template.md- Implementation plan templatetasks-template.md- Task breakdown templatechecklist-template.md- Quality checklist template
6. Test the Translation
SPECIFY_LANG={lang_code} spec-mix init test-project
Fallback Behavior
If a translation is missing:
- String not found: Shows
[MISSING: key.path] - Command file not found: Falls back to English
- Template not found: Falls back to English
This ensures Spec Kit always works, even with partial translations.
Technical Implementation
LocaleManager Class
The LocaleManager class (src/specmix/i18n.py) handles:
- Locale detection
- String loading with fallback
- Deep merging of translations
- Template path resolution
Key Functions
from specmix.i18n import get_locale_manager, t, init_i18n
# Initialize i18n (done automatically by CLI)
init_i18n()
# Get current locale manager
lm = get_locale_manager()
# Translate a string
message = t('cli.init.project_ready')
# Check current locale
current_lang = lm.current_locale # e.g., "ko"
# Get available locales
installed = lm.get_installed_locales() # ['en', 'ko']
supported = lm.get_supported_locales() # Full config list
Best Practices
For Users
- Set language once: Use
SPECIFY_LANGenvironment variable - Check available languages: Run
spec-mix lang listto see what's available - Report translation issues: Open GitHub issue if translations are incorrect
For Contributors
- Keep translations consistent: Use the same terminology throughout
- Preserve formatting: Maintain markdown formatting, placeholders, etc.
- Test thoroughly: Run through full workflow in translated language
- Update all files: When adding new features, update all language files
Troubleshooting
Language not being detected
# Check current language
spec-mix lang current
# Set explicitly
export SPECIFY_LANG=ko
spec-mix lang current
Partial English in translated interface
This means some strings are not yet translated. Check:
locales/{lang}/strings.jsonfor missing CLI messageslocales/{lang}/commands/for missing command translationslocales/{lang}/templates/for missing template translations
Cannot install language pack
Language pack installation from GitHub releases is coming in a future update. For now, all supported languages are bundled with the main package.
Future Enhancements
- [ ] Download language packs from GitHub releases
- [ ] Community-contributed translations
- [ ] Translation completeness checking tool
- [ ] In-app language switching without restart
- [ ] Regional variants (en-US, en-GB, zh-CN, zh-TW)