rich_i18n_cli

package badge pub points pub likes codecov ci badge license pub publisher

A CLI tool for verifying rich i18n text in ARB translation files and generating error reports.

Installation

dart pub global activate rich_i18n_cli

Usage

# verify rich i18n using l10n.yaml configuration file and saving report to "text_rich_i18n_styled_error" file
rich_i18n_cli verify

# verify rich i18n using arb-dir directory and saving report to "text_rich_i18n_styled_error" file
rich_i18n_cli verify --arb-dir my_arb_dir

# verify rich i18n using arb-dir directory and saving report to "report.txt" file
rich_i18n_cli verify --arb-dir my_arb_dir --output report.txt

# more info about usage
rich_i18n_cli verify --help

verify

output

The verify command generates a report file containing statistics and errors for each ARB file analyzed. The report structure includes:

  • validKeys: Number of translation keys that passed validation
  • invalidKeys: Number of translation keys with errors
  • errors: Object mapping translation keys to their error messages

Example

Given an ARB file (arb/en.arb):

{
    "title": "Hello <b>World</b>!",
    "description": "Malformed <b>text", // tag is not closed
    "body": "Unrecognized <foo>tag</foo>" // foo is not a valid tag in rich_text
}

The generated report will be:

{
  "./arb/en.arb": {
    "validKeys": 1,
    "invalidKeys": 2,
    "errors": {
      "description": "Invalid XML tag: Expected </b>, but found </root>",
      "body": "Unrecognized tag: foo"
    }
  }
}

Libraries

rich_i18n_cli
rich_i18n_cli, A CLI tool for verifying rich i18n text in ARB translation files and generating error reports.