translations_code_gen library

A comprehensive library for generating Dart code from translation files.

This library provides functionality to generate Dart constants, value maps, and JSON files from translation source files, making it easier to work with internationalization in Flutter and Dart applications.

The library supports multiple generation modes and integrates seamlessly with the easy_localization package for Flutter internationalization.

Key features:

  • Generate Dart key constants with type-safe access
  • Generate Dart value maps for runtime translation lookup
  • Generate JSON value files for external consumption
  • Support for nested translation structures
  • Integration with easy_localization package
  • Configurable input and output paths

Example usage:

import 'package:translations_code_gen/translations_code_gen.dart';

// Generate both keys and values
await translationCodeGen(['--generate=dart']);

// Generate only key constants
await translationCodeGen(['-g=dart-keys']);

See also:

Functions

translationCodeGen(List<String> arguments) → void
Generates Dart code from translation files based on the provided arguments.