Skip to content

Conversation

itashia
Copy link

@itashia itashia commented Jun 6, 2025

refactor(TranslateService): enhance readability, flexibility & error handling

  • Renamed variables to more descriptive names (e.g., translate_fromsourceLanguage)
  • Added caching mechanism for repeated translations
  • Introduced dry-run mode to allow testing without saving
  • Added option to disable parameter preservation
  • Improved error messages for better debugging
  • Added strict type hints for better static analysis
  • Split large methods into smaller single-responsibility methods
  • Validated source and target languages for correctness

Thank you so much for your thoughtful feedback and contributions — you've made this service cleaner, smarter, and easier to maintain. 🙏

refactor(TranslateService): enhance readability, flexibility & error handling

- Renamed variables to more descriptive names (e.g., `translate_from` ➝ `sourceLanguage`)
- Added caching mechanism for repeated translations
- Introduced dry-run mode to allow testing without saving
- Added option to disable parameter preservation
- Improved error messages for better debugging
- Added strict type hints for better static analysis
- Split large methods into smaller single-responsibility methods
- Validated source and target languages for correctness

Thank you so much for your thoughtful feedback and contributions — you've made this service cleaner, smarter, and easier to maintain. 🙏
@alisalehi1380
Copy link
Owner

Hey @itashia

Thanks for the PR. ❤️
I'll look into it as soon as possible.

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.

2 participants