---
title: Internationalization and Languages
---

# Internationalization and Languages

ZCF provides comprehensive internationalization (i18n) support, allowing you to flexibly configure CLI interface language, AI output language, and template language to meet language needs in different scenarios.

## Language Configuration Levels

ZCF's language system is divided into three independent but related levels:

1. **CLI Language**: Interface language of ZCF tool itself
2. **AI Output Language**: Language used for AI assistant replies
3. **Template Language**: Language of workflow templates and prompts

These three levels can be configured independently to meet various mixed scenario needs.

## CLI Language

CLI language controls the interface display language of ZCF command-line tool.

### Supported Languages

- `zh-CN`: Simplified Chinese
- `en`: English

### Language Priority

CLI language is determined according to the following priority:

1. Command line parameters `--all-lang` or `--lang`
2. `preferredLang` in configuration file
3. Interactive selection
4. System default (`en`)

### Set CLI Language

```bash
# Through command line parameters
npx zcf --lang zh-CN
npx zcf init --lang zh-CN

# Through unified language parameter (recommended)
npx zcf --all-lang zh-CN

# Switch in main menu
npx zcf
# Enter 0 to switch language

# Configuration file location
cat ~/.ufomiao/zcf/config.toml | grep preferredLang
```

### Language Switch Implementation

Language switching is implemented through the following functions:

- `changeLanguage`: Switch i18n language
- `resolveAndSwitchLanguage`: Resolve and switch language (considering priority)

## AI Output Language

AI output language controls the language used for AI assistant replies and generated content, which can be different from CLI language.

### Supported Language Options

- `zh-CN`: Chinese output
- `en`: English output
- `custom`: Custom language instructions

### Set AI Output Language

```bash
# Set during initialization
npx zcf init --ai-output-lang zh-CN

# Or use unified parameter
npx zcf init --all-lang zh-CN

# Configure in main menu
npx zcf
# Select 6 (Configure AI Memory & Output Style)
# Then select AI output language
```

### Custom Language Instructions

Using `custom` option allows input of custom language instructions:

```bash
npx zcf init --ai-output-lang custom
# Then enter: Reply in Japanese, maintain professional and polite tone
```

Custom instructions will be written to `CLAUDE.md` or `AGENTS.md`, affecting AI output language and style.

### AI Output Language Configuration Location

- **Claude Code**: Language instructions in `~/.claude/CLAUDE.md`
- **Codex**: Language instructions in `~/.codex/AGENTS.md`

## Template Language

Template language controls the language version of workflow templates, prompts, and system prompts.

### Supported Languages

- `zh-CN`: Chinese templates
- `en`: English templates

### Template Language Independence

Template language is independent of CLI language and can be flexibly combined:

```bash
# Chinese interface + English templates (suitable for scenarios requiring English documentation)
npx zcf init --lang zh-CN --config-lang en

# English interface + Chinese templates (suitable for international teams)
npx zcf init --lang en --config-lang zh-CN

# Unified language (recommended for most scenarios)
npx zcf init --all-lang zh-CN
```

### Set Template Language

```bash
# Set during initialization
npx zcf init --config-lang zh-CN

# Set during update
npx zcf update --config-lang zh-CN

# Or use unified parameter
npx zcf init --all-lang zh-CN
```

### Template Language Resolution

Template language is determined through `resolveTemplateLanguage` function:

1. Command line parameter `--config-lang`
2. `templateLang` in configuration file
3. Current CLI language (if not specified)
4. System default (`en`)

## Codex Language Configuration

After switching to Codex, language configuration rules are the same:

```bash
# Codex initialization, use Chinese
npx zcf init -T codex --all-lang zh-CN

# Switch language in Codex menu
# Menu in Codex mode will provide language switch options
```

## Usage Scenarios

### Scenario 1: Chinese Environment (Recommended)

Suitable for most Chinese users:

```bash
npx zcf init --all-lang zh-CN
```

Result:
- CLI Interface: Chinese
- AI Output: Chinese
- Template Files: Chinese

### Scenario 2: Chinese Interface + English Code

Suitable for projects requiring English code comments:

```bash
npx zcf init --lang zh-CN --ai-output-lang en --config-lang zh-CN
```

Result:
- CLI Interface: Chinese
- AI Output: English (code comments and documentation)
- Template Files: Chinese

### Scenario 3: International Team

Suitable for international teams requiring English documentation:

```bash
npx zcf init --lang en --config-lang en --ai-output-lang en
```

Result:
- CLI Interface: English
- AI Output: English
- Template Files: English

### Scenario 4: Mixed Configuration

Flexibly combine to meet specific needs:

```bash
# Chinese interface, Chinese templates, custom AI output
npx zcf init \
  --lang zh-CN \
  --config-lang zh-CN \
  --ai-output-lang custom
# Enter: Use Chinese to reply, code comments use English
```

## Best Practices

### 1. Team Unified Configuration

In team collaboration, it's recommended to unify language configuration:

```bash
# Team uniformly uses Chinese
npx zcf init --all-lang zh-CN

# Or team uniformly uses English
npx zcf init --all-lang en
```

This ensures:
- Consistent team member experience
- Unified document formats
- Smoother collaboration

### 2. Project-Specific Configuration

Different projects may have different needs:

```bash
# Open source projects: Use English
npx zcf init --all-lang en

# Internal projects: Use Chinese
npx zcf init --all-lang zh-CN

# Mixed projects: Chinese interface + English output
npx zcf init --lang zh-CN --ai-output-lang en
```

### 3. Multi-Language Documentation

If multi-language documentation is needed:

```bash
# 1. First generate complete documentation in Chinese
npx zcf init --all-lang zh-CN
# Complete feature development, generate Chinese documentation

# 2. Switch to English, update documentation
npx zcf update --config-lang en
# Generate English version of documentation

# 3. Use GitBook multi-language functionality to manage
```

### 4. Configuration File Management

Language configuration is saved in ZCF global configuration:

```bash
# View current configuration
cat ~/.ufomiao/zcf/config.toml

# Configuration file fields
# preferredLang: CLI language preference
# templateLang: Template language preference
# aiOutputLang: AI output language preference
```

### 5. Scripted Configuration

Explicitly specify language in automation scripts:

```bash
#!/bin/bash
# Deployment script

# Explicitly specify all language parameters
npx zcf init -s \
  --all-lang zh-CN \
  --provider 302ai \
  --api-key "$API_KEY"
```

## Troubleshooting

### Language Configuration Not Effective

If language configuration is not effective:

```bash
# 1. Check configuration file
cat ~/.ufomiao/zcf/config.toml | grep -E "preferredLang|templateLang|aiOutputLang"

# 2. Reinitialize and explicitly specify
npx zcf init --all-lang zh-CN

# 3. Check environment variables (if set)
echo $LANG
```

### Template Language Doesn't Match Expected

If template language doesn't match expected:

```bash
# 1. Explicitly specify template language
npx zcf init --config-lang zh-CN

# 2. Update existing configuration
npx zcf update --config-lang zh-CN

# 3. Check template files
ls -la ~/.claude/workflows/
# View language version of template files
```

### AI Output Language Incorrect

If AI output language is incorrect:

```bash
# 1. Check CLAUDE.md or AGENTS.md
cat ~/.claude/CLAUDE.md | grep -i language
cat ~/.codex/AGENTS.md | grep -i language

# 2. Reconfigure AI output language
npx zcf
# Select 6 (Configure AI Memory & Output Style)

# 3. Or directly edit configuration file
vim ~/.claude/CLAUDE.md
# Add language instructions
```

## Related Resources

- [Configuration Management](configuration.md) - Detailed configuration management guide
- [Template System](templates.md) - Template language and customization
- [Quick Start](../getting-started/installation.md) - Initialization process

> 💡 **Tip**: Proper language configuration can greatly improve development efficiency and team collaboration experience. It's recommended to choose appropriate language configuration based on project needs and team situation. Most Chinese users are recommended to use `--all-lang zh-CN` for the best experience.


