laravel-lang-files-translator
laravel-lang-files-translator copied to clipboard
Update TranslateService.php
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. 🙏