Skip to content

feat: v1.1.0 - add i18n and debug logging

Choose a tag to compare

@henrychen95 henrychen95 released this 02 Jan 17:18
· 4 commits to main since this release

This major update introduces comprehensive internationalization, Japanese language support,
configurable debug logging, and significantly enhanced documentation.

New Features

Multilingual Support (i18n)

  • Add Japanese language support (en, zh-TW, ja)
  • Implement dual-layer language mechanism (config UI + runtime messages)
  • Add automatic system language detection (Windows/macOS/Linux)
  • Create comprehensive i18n system with translation modules (src/locales/)
  • Add language-specific translations for all UI elements, status messages, and error handling

Configurable Debug Logging

  • Add enableDebugLogging configuration option
  • Add debugLogPath configuration with custom path support
  • Refactor debug function to read from plugin config instead of hardcoded path
  • Auto-create log directory if missing
  • Support environment variable fallback during initialization

Documentation

New Documentation Structure

  • Create docs/ directory for developer documentation
  • Create tests/ directory for test files
  • Move development docs to organized structure

I18N Documentation (3 languages)

  • Add docs/I18N.md (English) - Comprehensive i18n system guide
  • Add docs/I18N.zh-TW.md (Traditional Chinese) - Full translation
  • Add docs/I18N.ja.md (Japanese) - Full translation
  • Add docs/README.md - Documentation directory index

README Overhaul (EN/ZH-TW/JA)

  • Add Japanese README (README.ja.md)
  • Add 5 detailed use case examples with configuration tips
  • Add "Example Conversations" section (small vs large file handling)
  • Add "Advanced Configuration Guide" (thresholds, multilingual setup)
  • Expand troubleshooting section (3 → 5+ common issues)
  • Add embedding model comparison table with speed indicators
  • Add file format support table
  • Expand RAG-v1 comparison table with new features
  • Add multilingual configuration section with links to I18N docs
  • Fix BGE-M3 speed description (add quantization-level details: F16 vs Q4)
  • Fix language troubleshooting section (UI → Runtime messages)

Locales Documentation

  • Add src/locales/README.md - Developer guide for translation files
  • Add src/locales/README.zh-TW.md - Traditional Chinese version
  • Add src/locales/README.ja.md - Japanese version
  • Update all README cross-references to new docs structure

Code Changes

Configuration (src/config.ts)

  • Export DEFAULT_EMBEDDING_MODELS constant (centralized definition)
  • Add debug logging configuration fields
  • Update CONFIG_KEYS with ENABLE_DEBUG and DEBUG_LOG_PATH
  • Fix language default value bug (use getLanguageDisplayText() for all languages)
  • Add translations for debug logging in all languages

Core Module (src/index.ts)

  • Import DEFAULT_EMBEDDING_MODELS from config (remove duplication)
  • Refactor debug function to use plugin config
  • Export pluginContext for debug function access
  • Remove hardcoded debug path
  • Add comprehensive system locale detection logging

Internationalization (src/i18n.ts - NEW)

  • Implement detectSystemLanguage() with environment variable detection
  • Support LANG, LANGUAGE, LC_ALL environment variables
  • Add locale mapping for zh-TW, zh-HK, ja, zh-CN
  • Implement setLanguage() and t() translation helpers

Translation Files (src/locales/ - NEW)

  • Add types.ts - TypeScript interfaces for translations
  • Add en.ts - English translations (44 items)
  • Add zh-TW.ts - Traditional Chinese translations (44 items)
  • Add ja.ts - Japanese translations (44 items)
  • Add index.ts - Central export point for all translations

Prompt Preprocessor (src/promptPreprocessor.ts)

  • Update to use i18n system for all user-facing messages
  • Apply runtime language selection to status and error messages

Version Updates

  • package.json: 1.0.1 → 1.1.0
  • manifest.json: revision 2 → 3

Fixes

  • Fix language configuration to support all three languages properly
  • Fix BGE-M3 model speed description (clarify F16 vs Q4 quantization)
  • Fix troubleshooting section title (UI language → Runtime messages language)
  • Consolidate duplicate DEFAULT_EMBEDDING_MODELS definitions

Developer Experience

  • Organize documentation in docs/ directory for easier navigation
  • Create centralized docs/README.md with documentation index
  • Move test files to tests/ directory
  • Add comprehensive I18N guides for contributors
  • Update all cross-references between documentation files

Translation Coverage

Each language file includes:

  • Config UI: 7 settings × 2 fields = 14 strings
  • Status Messages: 14 functions/strings
  • Error Messages: 3 functions
  • LLM Prompts: 8 functions
  • Verbs: 5 strings

Total per language: ~44 translatable items