Skip to content

Conversation

@lisy09
Copy link

@lisy09 lisy09 commented Sep 27, 2025

🌟 Overview

This PR adds comprehensive Chinese language template support to the spec-workflow-mcp project, including Chinese Markdown templates and enhanced internationalization features.

📝 What's Added

1. Chinese Markdown Templates

  • New Directory: src/markdown/templates/zh/
  • Tech Template: tech-template.md - Chinese technical documentation template
  • Includes:
    • Chinese technical architecture descriptions
    • Chinese API documentation format
    • Chinese code examples and best practices
    • Chinese performance optimization guidelines

2. Template Structure

src/markdown/templates/
├── ... (existing English templates)
└── zh/
    ├── design-template.md      # Design document template
    ├── product-template.md     # Product document template  
    ├── requirements-template.md # Requirements document template
    ├── structure-template.md   # Architecture document template
    ├── tasks-template.md       # Tasks document template
    └── tech-template.md        # Technical document template

🔧 Technical Changes

File Changes

  • Added src/markdown/templates/zh/tech-template.md
  • Additional Chinese template files to follow

Internationalization Support

  • Maintains structural consistency with existing English templates
  • Supports parallel Chinese and English template usage
  • Provides Chinese content support for VS Code extension

✅ How to Verify

1. Local Verification

# Check the new Chinese template files
ls -la src/markdown/templates/zh/

# Verify template content format
cat src/markdown/templates/zh/tech-template.md

# Build the project to ensure no errors
npm run build

# Run tests to ensure functionality
npm test

2. Functional Verification

  • Chinese tech template file exists and is properly formatted
  • Template content follows Chinese technical documentation standards
  • Project builds successfully without errors
  • VS Code extension can load Chinese templates correctly
  • Dashboard interface can display Chinese content properly

3. Usage Verification

# Start development server
npm run dev

# Visit Dashboard to check Chinese support
open http://localhost:3000

# Test creating Chinese spec document
node dist/index.js create-spec --template zh/tech-template

Also test with mcp server mode adding '--language zh'

🎯 Impact Scope

  • User Interface: Supports Chinese template selection
  • Document Generation: Can generate Chinese technical documents
  • Internationalization: Provides better experience for Chinese users
  • Backward Compatibility: Does not affect existing English template functionality

This PR provides complete technical documentation template support for Chinese users, enhancing the project's internationalization capabilities.

@lisy09 lisy09 changed the title Add Chinese template support feat: 添加中文模板支持 (Add Chinese Template Support) Sep 27, 2025
@lisy09
Copy link
Author

lisy09 commented Sep 27, 2025

Hi @Pimzino , just created a PR to Add Chinese Template Support (and potentially any language support).
Is it possible to involve this feature in the mainline?

@Pimzino Pimzino requested a review from Copilot November 7, 2025 13:43
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds internationalization (i18n) support to the Spec Workflow MCP server, enabling users to specify their preferred language for template generation. The implementation adds a --language CLI parameter that supports Chinese (zh) templates initially, with infrastructure to support additional languages (ja, es, fr, de, it, ko, ar) as mentioned in the help text.

Key changes:

  • Added language parameter support to CLI with both --language zh and --language=zh formats
  • Modified WorkspaceInitializer to accept language parameter and implement template selection logic with fallback to English
  • Created Chinese (zh) translations for all 6 template files (product, requirements, design, tech, structure, tasks)

Reviewed Changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/index.ts Added --language CLI parameter parsing with validation and help documentation
src/server.ts Updated WorkspaceInitializer instantiation to pass language parameter
src/core/workspace-initializer.ts Implemented language-aware template loading with fallback mechanism
src/markdown/templates/zh/*.md Added Chinese translations for all 6 template files
README.md Added language support documentation with Chinese usage examples

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +113 to +115
# Use Japanese templates
npx -y @pimzino/spec-workflow-mcp@latest /path/to/your/project --language ja

Copy link

Copilot AI Nov 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The documentation lists Japanese (ja) as a supported language in line 114 and in the help text (line 34 of index.ts), but no Japanese templates exist in the codebase. Either add the Japanese templates in src/markdown/templates/ja/ or remove references to Japanese language support from the documentation until templates are available.

Suggested change
# Use Japanese templates
npx -y @pimzino/spec-workflow-mcp@latest /path/to/your/project --language ja

Copilot uses AI. Check for mistakes.
Comment on lines +33 to +34
--language <code> Set language for internationalization (e.g., zh, en, ja)
Supported languages: en, zh, ja, es, fr, de, it, ko, ar
Copy link

Copilot AI Nov 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The help text claims support for 9 languages (en, zh, ja, es, fr, de, it, ko, ar), but only English and Chinese templates currently exist. This creates misleading expectations. Either add templates for all listed languages or update the documentation to reflect only currently available languages (en, zh).

Suggested change
--language <code> Set language for internationalization (e.g., zh, en, ja)
Supported languages: en, zh, ja, es, fr, de, it, ko, ar
--language <code> Set language for internationalization (e.g., zh, en)
Supported languages: en, zh

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant