babel 0.0.1-prerelease copy "babel: ^0.0.1-prerelease" to clipboard
babel: ^0.0.1-prerelease copied to clipboard

Babel is a CLI tool for translations management for Flutter apps

Babel #

Translations management for Flutter apps

Pub Version Pub Publisher Pub Points

Build codecov Language License: MIT

Getting started #

babel-banner

Babel is a command-line interface (CLI) tool crafted to simplify the management of translations in Flutter applications.

This intuitive toolset allows you to effortlessly:

  • List Project's Translations

    Easily examine your project's language resources, identifying existing, missing, or unused translations.

    Utilize the power of AnsiX to print reports in data grids, tree views, or JSON format. Additionally, you can export them to files for convenient reference.

  • Sort Translations

    Keep your translation files organized for enhanced readability and maintainability, making it easier for you and your team to work with translations effectively.

  • Clean Generated Files

    Optimize your project's footprint by removing redundant or unused translation keys, ensuring a lean and efficient application build.

Babel is a valuable asset for Flutter developers looking to streamline their localization workflow. Its user-friendly interface provides essential functionalities to ensure your project's internationalization process is seamless and efficient.

Disclaimer

Please note that Babel is specifically designed to work in conjunction with Flutter's official localization tools.

It is not compatible with or intended for use alongside other third-party packages for localization.

To ensure seamless functionality and optimal performance, we recommend utilizing Babel exclusively with Flutter's official localization capabilities.

list-all-grid

How to use #

Add as dependency #

# Add Babel as a dev dependency in your pubspec.yaml
dart pub add -d babel

# Run babel
dart run babel [command] [arguments]

Activate globally #

# Activate Babel from pub.dev
dart pub global activate babel

# Run babel
babel [command] [arguments]

Commands #

Babel uses dart_cmder for the CLI interface.

Base arguments #

Argument Help Allowed values Defaults to
--path, -p The root path of the project where the pubspec.yaml is. .
--level, -l Define the level that will be used to filter log messages. none, verbose, debug, info, success, warning, error, fatal info
--logdir, -d If not null, then messages will be logged into the specified directory. null

List #

Argument Help Allowed values Defaults to
--mode, -m Defines how the report will be displayed. grid, tree, json grid
--export-directory, -e If this field is not empty, it will be used to export the results.
  • Grid
list-all-grid
  • Tree
list-all-tree
  • JSON
list-all-json

All

List all translation keys of the project.

babel list all

Missing

List all missing translation keys of the project.

babel list missing

Unused

List all unused translation keys of the project.

babel list unused

Sort #

Sorts the translation keys in the arb files of the project.

babel list sort

Clean #

Unused

Deletes all unused translation keys.

babel list clean unused

Generated

Deletes all generated localization files.

babel list clean generated

Contribution #

Check the contribution guide if you want to help with dart_cmder.

Changelog #

Check the changelog to learn what's new in dart_cmder.