Skip to content

refactor(i18n): 🌐 refactor: replace hardcoded strings with i18n keys#48

Merged
YagoBorba merged 2 commits into
developfrom
feature/refactor-hardcoded-strings-i18n
Aug 19, 2025
Merged

refactor(i18n): 🌐 refactor: replace hardcoded strings with i18n keys#48
YagoBorba merged 2 commits into
developfrom
feature/refactor-hardcoded-strings-i18n

Conversation

@YagoBorba
Copy link
Copy Markdown
Owner

📋 Description

This PR implements comprehensive internationalization (i18n) support by refactoring all hardcoded strings in the VS Code extension to use translation keys. The changes ensure better maintainability and prepare the project for multi-language support.

Key Changes:

  • Refactored all VS Code extension commands to use i18n translation keys
  • Added comprehensive translation keys for English and Portuguese
  • Updated ConfigCommand, CommitCommand, ReleaseCommand, ValidateCommand, InitCommand, GenerateCommand, and GitCommand
  • Enhanced FileMonitor to use i18n for error messages and notifications
  • Added missing translation keys for UI elements, error handling, and user interactions
  • Fixed type errors and compilation issues

🔗 Related Issue

Fixes #47

🧪 Type of Change

  • ♻️ Refactoring
  • 🌐 Internationalization and localization
  • 🧹 Code cleanup

📝 How Has This Been Tested?

  • Unit tests pass (core package tests passing)
  • Manual testing completed (compilation successful for all packages)
  • TypeScript compilation passes for all affected packages
  • VS Code extension compiles without errors

Test Results:

✓ packages/core tests: 9 passed (9)
✓ packages/i18n compilation: successful
✓ packages/vscode-extension compilation: successful
✓ packages/cli compilation: successful

📷 Screenshots (if applicable)

N/A - This is a refactoring change that maintains existing functionality while adding i18n support.

✅ Checklist

  • My code follows the project's coding standards
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have checked my code and corrected any misspellings

🔄 Dependencies

  • Uses existing @stackcode/i18n package
  • No new external dependencies added
  • Maintains compatibility with existing VS Code extension API

📚 Additional Notes

Translation Coverage:

  • English (en.json): Complete translation set with 80+ keys
  • Portuguese (pt.json): Complete translation set with 80+ keys
  • Organized by feature areas: common, config, commit, release, validate, init, generate, git, dashboard

Impact:

  • Breaking Changes: None - all functionality preserved
  • Performance: Minimal impact - translations loaded once at startup
  • Maintainability: Significantly improved - centralized string management
  • Future: Ready for additional language support

Files Modified:

  • packages/i18n/src/locales/en.json - Added comprehensive English translations
  • packages/i18n/src/locales/pt.json - Added comprehensive Portuguese translations
  • packages/vscode-extension/src/commands/*.ts - Refactored all command classes
  • packages/vscode-extension/src/monitors/FileMonitor.ts - Added i18n support

Issue Reference: Closes #47

@YagoBorba YagoBorba self-assigned this Aug 19, 2025
@YagoBorba YagoBorba added the refactor Code improvements that do not add new features or fix bugs. label Aug 19, 2025
@YagoBorba YagoBorba merged commit 213be6b into develop Aug 19, 2025
4 checks passed
@YagoBorba YagoBorba deleted the feature/refactor-hardcoded-strings-i18n branch August 19, 2025 22:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactor Code improvements that do not add new features or fix bugs.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refactor all hardcoded strings to use i18n keys

1 participant