excel_translator 2.3.0
excel_translator: ^2.3.0 copied to clipboard
Generate type-safe Flutter localizations from Excel, CSV, and ODS files with multi-sheet support and automatic validation.
Changelog #
2.3.0 - 2026-09-01 #
Features #
- Add
filesconfiguration for combining multiple translation inputs into one generated localization API. CSV filenames become module names, while XLSX and ODS sources preserve their existing sheet names. - Support mixed
.csv,.xlsx, and.odssources through one shared parsing pipeline used by both the CLI and build runner. - Register every configured input as a build runner dependency, so changing any source triggers localization regeneration.
Validation #
- Reject configurations containing both
excel_fileandfiles. - Report duplicate paths, missing files, unsupported extensions, empty paths, invalid module names, and module collisions instead of silently overwriting.
Compatibility #
- Keep existing
excel_fileconfiguration andmulti_fileoutput behavior. - Preserve the legacy
defaultmodule for CSV files configured throughexcel_file; filename-derived module names apply to the newfilesmode.
2.2.0 - 2026-08-03 #
Fixes #
- Escape translation values before writing them into generated code. Values were
interpolated raw into
'''...'''literals, so a$,''',\or${...}produced code that did not compile — and${...}was executed as Dart in the consuming app. Values are now emitted as fully escaped single-quoted literals. (Modified: lib/src/generators/sheet_class_generator.dart, lib/src/utils/string_utils.dart) - Collect interpolation parameters from every language instead of only the first
one. A placeholder that existed in one translation but not another
(
en: "Hello",id: "Halo {name}") leaked into the UI as literal text. (Modified: lib/src/generators/sheet_class_generator.dart) - Validate placeholder names.
{1+1}used to be emitted as the parameterdynamic 1+1; unusable names now stay literal text, and positional printf params (%1$s) becomearg1. (Modified: lib/src/utils/string_utils.dart) - Resolve locales through the new generated
resolveLanguage()helper.of(context),getSystemLanguage()and the delegate matched onlylocale.languageCode, so a sheet using country variants (en_US) never matched and always fell back to the default value. (Modified: lib/src/generators/main_class_generator.dart) - Key translation values by the normalized language code. A header written as
en_USwas stored asen_USbut looked up asen_us, which emptied the entire column in the generated code. (Modified: lib/src/models/language.dart, lib/src/parsers/csv_parser.dart, lib/src/parsers/excel_parser.dart, lib/src/parsers/ods_parser.dart)
Changes #
- Generated files carry
// ignore_for_file: type=lint, and interpolations omit unnecessary braces, so generated code no longer trips consumer lint rules. - Interpolation happens through real Dart string interpolation instead of a
chain of
replaceAllcalls at runtime. - New generator tests: escaping, interpolation and locale resolution, plus a
test that runs
dart analyzeand executes the generated code. (Added: test/src/generators/)
2.1.9 - 2026-07-31 #
Changes #
- Fix UTF-8 decoding in CSV parser:
String.fromCharCodesdecoded bytes as Latin-1, mangling every non-ASCII character (emoji, accents, CJK) into mojibake in generated localizations. Now decodes withutf8.decodeand strips a leading UTF-8 BOM from Excel/Sheets exports. (Modified: lib/src/parsers/csv_parser.dart)
2.1.8 - 2026-05-30 #
Changes #
- Add string sanitization methods for interpolation parameters and update tests (Modified: lib/src/utils/string_utils.dart)
2.1.7 - 2026-05-22 #
Changes #
- Fix build.yaml: restore required build_extensions field (Modified: build.yaml)
- Refactor build configuration by removing build_extensions from build.yaml and updating output directory documentation in builder.dart (Modified: build.yaml)
- Enhance Excel Translator configuration to support multi-file generation option and update CLI for new argument parsing (Modified: lib/builder.dart)
- Update Excel Translator configuration to use CSV file for translations and enhance output directory handling in builder (Modified: CHANGELOG.md)
- Update README to enhance clarity on localization features and usage instructions (Modified: README.md)
- Update CHANGELOG for version 2.1.5; bump version in README and pubspec.yaml (Modified: CHANGELOG.md)
- Refactor localization classes and enhance logging in LanguageService (Deleted: example/lib/generated/buttons_localizations.dart)
- Add settings configuration, refactor builders, and improve localization generation logic (Added: .claude/settings.local.json)
2.1.6 - 2026-05-22 #
Changes #
- Update README to enhance clarity on localization features and usage instructions (Modified: README.md)
- Update CHANGELOG for version 2.1.5; bump version in README and pubspec.yaml (Modified: CHANGELOG.md)
- Refactor localization classes and enhance logging in LanguageService (Deleted: example/lib/generated/buttons_localizations.dart)
- Add settings configuration, refactor builders, and improve localization generation logic (Added: .claude/settings.local.json)
2.1.5 - 2026-05-22 #
Changes #
- Add optional
build_runnerintegration support - Refactor localization generator architecture for CLI and Builder modes
- Improve localization generation flow and logging
- Remove
example/lib/generated/buttons_localizations.dart
2.1.4 - 2026-05-20 #
Fixed #
- Fix CSV parser to properly handle commas inside quoted fields by setting
textDelimiter: '"'parameter in TableParser
2.1.3 - 2026-02-18 #
Changes #
- Fix translation for 'findProduct' in Spanish (Modified: example/lib/generated/login_localizations.dart)
- Update example_localizations.xlsx with new translations (Modified: example/assets/example_localizations.xlsx)
- Add build configuration and localization support for Excel Translator (Added: build.yaml)
- Add pub.dev badges to README (Modified: README.md)
- Update version to 2.1.2 in changelog, README, and pubspec.yaml (Modified: CHANGELOG.md)
- Refactor logging messages in LanguageService and Logger for consistency by removing emojis and standardizing format (Modified: lib/src/services/language_service.dart)
- Remove timestamp comments from generated localization files and update README for clarity on automatic publishing setup (Modified: README.md)
2.1.2 - 2026-02-05 #
Changes #
- Refactor logging messages in LanguageService and Logger for consistency by removing emojis and standardizing format (Modified: lib/src/services/language_service.dart)
- Remove timestamp comments from generated localization files and update README for clarity on automatic publishing setup (Modified: README.md)
2.1.1 - 2026-01-09 #
Changes #
- Add version management script to automate version updates and changelog generation (Added: bin/increase_version.dart)
- Update generated localization files with new timestamps and formatting improvements (Deleted: .github/workflows/publish.yml)
2.1.0 - 2026-01-08 #
New Features #
- Added --version and -v flags to CLI for checking package version
- Display version information in help output
- Improved version detection to show main package version consistently across directories
Bug Fixes #
- Fixed Dart keyword conflict in generated property names (e.g., 'default' -> 'defaultValue')
- Resolved compilation errors when sheet names match Dart reserved keywords
Internal Improvements #
- Enhanced CLI argument parsing and help display
- Better error handling for version reading
- Improved code generation robustness
Major Architecture Refactoring #
- Simplified Structure: Replaced complex Clean Architecture with streamlined service-oriented design
- Removed Layers: Eliminated unnecessary domain/data/application/presentation layers
- Unified Models: Consolidated entities into single
modelspackage - Streamlined Services: Merged repositories and use cases into
serviceslayer - Enhanced Parsers: Split data sources into dedicated
parsersfor input processing - Optimized Generators: Created focused
generatorsfor output code generation - Improved Utils: Centralized utilities in dedicated
utilspackage
Bug Fixes #
- Fixed CLI exit handling for better testability
- Resolved config merging issues with nullable types
- Fixed table alignment in README.md documentation
Internal Improvements #
- Better error handling and validation
- Improved code maintainability and readability
- Enhanced type safety throughout the codebase
1.0.7 - 2025-10-08 #
- Fix running without arguments, automatically loading configuration from
pubspec.yaml - Added
dart run excel_translator logto print current pubspec configuration
1.0.6 - 2025-10-08 #
- Skip invalid columns, not entire sheets
- Fixed hyphenated names: auth-errors → AuthErrorsLocalizations
- Fixed interpolation: %param$s → {param}
1.0.5 - 2025-09-06 #
1.0.4 - 2025-09-06 #
Major Dependency Update #
- Unified Parser: Replaced individual packages (
excel,csv,spreadsheet_decoder) with unifiedtable_parserpackage - Enhanced Performance: Better memory handling and parsing performance for large files
- Improved CSV Support: Enhanced CSV parsing with better quote handling and custom separators
- Simplified Dependencies: Reduced from 3 separate packages to 1 unified solution
� Improvements #
- Fixed CSV and ODS file parsing issues
- Resolved missing language data file issues
- Improved error handling across all file formats
1.0.3 - 2025-09-04 #
Bug Fixes #
- Fixed CSV and ODS file parsing issues
- Resolved missing language data file issues
1.0.2 - 2025-09-04 #
New Features #
- Multi-Format File Support: Added CSV (.csv) and ODS (.ods) format support
- ODS Format Support: Full OpenDocument Spreadsheet (.ods) support using spreadsheet_decoder
- Added
spreadsheet_decoderpackage dependency for ODS parsing - Added
csvpackage dependency for CSV parsing - ODS files now support multiple sheets (same as Excel)
- Enhanced
FileFormatenum with modern Dart enhanced enum features - Comprehensive multi-format support: Excel (.xlsx), CSV (.csv), and ODS (.ods)
Enhanced #
- CLI Help: Updated help text to reflect full multi-format support
- Documentation: Added CSV and ODS examples and usage instructions
- Example Files: Added CSV and ODS example files in
example/assets/ - Format Detection: Improved file format detection with better error messages
1.0.1 - 2025-09-04 #
1.0.0 - 2024-12-19 #
Added #
- Initial release of Excel Translator
- Multi-sheet Excel file support
- Type-safe localization generation
- BuildContext extension for easy access
- String interpolation with dynamic parameters
- Command-line generation tool
- Comprehensive example application
- Support for multiple languages per sheet
- Automatic fallback handling
- Clean, modular code generation
Features #
- Generate localizations from Excel files with multiple sheets
- Access translations via
context.loc.sheetName.key - String interpolation support with
{variable}syntax - Type-safe parameter handling
- Automatic code generation with proper imports
- Support for unlimited languages and sheets