flutter_hardcode_localizer 1.0.3
flutter_hardcode_localizer: ^1.0.3 copied to clipboard
A Dart plugin that finds hardcoded strings in Flutter projects and provides quick-fix to move them to localization files for easy_localization.
Changelog #
1.0.3 - 2025-08-18 #
πReviewed Pub.dev Analysis #
New Features
- β **Added Example
- β **Platform support constraints updated
- β **Developer Comments added for classes
1.0.1 - 2025-08-14 #
π Enhanced for easy_localization Integration #
New Features
- β
LocaleKeys.key.tr() Format: Changed replacement format from
Locale.$keytoLocaleKeys.$key.tr() - β easy_localization Workflow: Perfect integration with the popular easy_localization package
- β Automated JSON Key-Value Creation: Eliminates manual process of adding translations
- β
Standard Directory Structure: Uses
assets/languages/following easy_localization conventions - β Enhanced Documentation: Added specific command for LocaleKeys generation with correct parameters
Technical Changes
- JsonManager: Updated to use
assets/languages/en.jsoninstead oflang/en.json - Path Standardization: Follows easy_localization standard directory structure
- pubspec.yaml Integration: Clear instructions for adding assets directory
Enhanced Command Reference
The README now includes the specific command for generating LocaleKeys:
dart run easy_localization:generate --source-dir assets/languages/ -f keys -O lib/ui/theme -o codegen_key.g.dart
Important Setup Note
Added crucial pubspec.yaml configuration requirement:
flutter:
assets:
- assets/languages/
Why This Update?
This version specifically addresses the tedious manual process of setting up easy_localization:
Before v1.0.1 (Manual Process):
- β Manually find all hardcoded strings
- β Manually add each to assets/languages/en.json
- β Manually replace each in code with LocaleKeys.key.tr()
- β Manually run code generation with correct parameters
- β Manually configure pubspec.yaml
After v1.0.1 (Automated):
- β
Add
assets/languages/to pubspec.yaml - β
Run:
dart run flutter_hardcode_localizer:localize - β
Run:
dart run easy_localization:generate --source-dir assets/languages/ -f keys -O lib/ui/theme -o codegen_key.g.dart - β Add import and test!
1.0.0 - 2025-08-14 #
π Initial Stable Release #
- β Smart hardcoded string detection
- β Interactive CLI with user prompts
- β Automatic JSON key generation
- β Reliable code transformation
- β Support for arrays, methods, constructors, maps
- β Comprehensive test coverage
- β Production-ready stability