smart_arb_translator 1.0.1
smart_arb_translator: ^1.0.1 copied to clipboard
An intelligent command-line utility for translating ARB files with Google Translate API, featuring smart change detection and modular architecture.
Changelog #
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
1.0.1 - 2024-05-26 #
Added #
- ๐ฏ Dual Localization Method Support: Choose between Flutter's built-in
gen-l10norintl_utilspackage - ๐ค Intelligent Auto-Detection: Automatically detects existing localization setup and chooses the appropriate method
- ๐ Auto-Configuration: Automatically creates
l10n.yamlor configurespubspec.yamlbased on chosen method - ๐ง Method Selection: New
--l10n_methodparameter to explicitly choose betweengen-l10nandintl_utils - ๐พ Preference Persistence: Saves user's localization method choice in
pubspec.yamlfor future runs - โ
Auto-Approve Option: New
--auto_approveflag to automatically approve configuration changes
Enhanced #
- ๐ง Smart Method Detection: Automatically detects:
- Existing
l10n.yamlfile โ Usesgen-l10n - Existing
intl_utilsdependency orflutter_intlconfig โ Usesintl_utils - Saved preference in
pubspec.yamlโ Uses saved method - No setup found โ Prompts user to choose (or defaults to
intl_utilswith--auto_approve)
- Existing
- ๐ Flutter gen-l10n Integration: Full support for Flutter's official localization solution
- ๐ Interactive Setup: User-friendly prompts when no existing setup is detected
- ๐ก๏ธ Safe Configuration: Asks for permission before modifying project files (unless auto-approved)
Technical Details #
- New Command Options:
--l10n_method: Choose betweengen-l10norintl_utils--auto_approve: Automatically approve configuration changes
- Auto-Configuration Features:
- Creates
l10n.yamlwith proper paths and class names forgen-l10n - Adds
intl_utilsdependency andflutter_intlconfig forintl_utils - Preserves existing file formatting and comments
- Creates
- Intelligent Detection Logic: Comprehensive project analysis to determine the best localization method
Usage Examples #
# Auto-detect and configure (interactive)
smart_arb_translator --source_dir lib/l10n --api_key api_key.txt --language_codes es,fr --generate_dart
# Force specific method
smart_arb_translator --source_dir lib/l10n --api_key api_key.txt --language_codes es,fr --generate_dart --l10n_method gen-l10n
# Auto-approve configuration changes
smart_arb_translator --source_dir lib/l10n --api_key api_key.txt --language_codes es,fr --generate_dart --auto_approve
1.0.0 - 2024-01-01 #
Added #
- ๐ Initial release of Smart ARB Translator
- โจ Smart Change Detection: Only translates modified or new content
- ๐๏ธ Modular Architecture: Refactored into clean, maintainable modules
- ๐ Batch Processing: Recursive directory translation support
- ๐ Automatic Merging: Seamless l10n directory integration
- ๐ฏ Manual Translation Override: Support for
@x-translationsmetadata - ๐ ๏ธ Flexible Output: Customizable file naming and directory structure
- ๐จ Robust Error Handling: Detailed feedback and error messages
- ๐ Comprehensive Documentation: Complete README with examples
- ๐งช Programmatic API: Use as a library in your Dart projects
Changed #
- ๐ Package Name: Renamed from
arb_translatortosmart_arb_translator - ๐๏ธ Architecture: Complete refactor into modular components:
TranslationService: Google Translate API integrationArbProcessor: ARB file processing and action managementFileOperations: File and directory utilitiesDirectoryProcessor: Batch directory processingSingleFileProcessor: Individual file processing with change detectionArbTranslatorArgumentParser: Command-line argument handlingConsoleUtils: Console output utilities
- ๐จ CLI Interface: Improved command-line experience
- ๐ฆ Dependencies: Updated to latest package versions
Enhanced #
- ๐ง Intelligence: Smart detection of changes to minimize API calls
- โก Performance: Optimized processing for large projects
- ๐ง Maintainability: Clean separation of concerns
- ๐ Documentation: Comprehensive guides and examples
- ๐ฏ User Experience: Better error messages and feedback
Technical Details #
- Minimum Dart SDK: 3.0.1
- Dependencies: Updated all dependencies to latest versions
- Architecture: Modular design with clear separation of concerns
- Testing: Foundation for comprehensive test coverage
- Documentation: Complete API documentation and usage examples
Migration from arb_translator #
If you're migrating from the original arb_translator package:
-
Update pubspec.yaml:
dev_dependencies: smart_arb_translator: ^1.0.0 # instead of arb_translator -
Update command usage:
smart_arb_translator # instead of pub run arb_translator:translate -
Argument changes:
--append-lang-code/--no-append-lang-code(instead of--append_lang_code)- All other arguments remain the same
-
New features available:
- Smart change detection (automatic)
- Improved error handling
- Better performance
- Programmatic API access
Acknowledgments #
- Originally forked from justkawal/arb_translator
- Enhanced with modern architecture and smart features
- Built for the Flutter community
Note: This is the first release of Smart ARB Translator as a standalone package. Future releases will follow semantic versioning with detailed changelogs.