Skip to content
Novus Examples
arb1.9 KB

Flutter ARB — ICU plurals and typed placeholders (English)

A English ARB whose plural messages carry an ICU branch for each of the 2 categories en selects, plus a select message and a summary line with typed placeholders — int with compactLong, and a DateTime with a yMMMd format — which is what makes gen_l10n emit a typed Dart method rather than a plain string.

Preview — first 50 linesarb
{
  "@@locale": "en",
  "@@last_modified": "2026-01-01T00:00:00Z",
  "files": "{count, plural, one{{count} file} other{{count} files}}",
  "@files": {
    "description": "Item count in the status bar",
    "placeholders": {
      "count": {
        "type": "int",
        "format": "decimalPattern"
      }
    }
  },
  "folders_selected": "{count, plural, one{{count} folder selected} other{{count} folders selected}}",
  "@folders_selected": {
    "description": "Selection summary",
    "placeholders": {
      "count": {
        "type": "int",
        "format": "decimalPattern"
      }
    }
  },
  "deleted_items": "{count, plural, one{Deleted {count} item} other{Deleted {count} items}}",
  "@deleted_items": {
    "description": "Undo toast after a delete",
    "placeholders": {
      "count": {
        "type": "int",
        "format": "decimalPattern"
      }
    }
  },
  "cats": "{count, plural, one{{count} cat} other{{count} cats}}",
  "@cats": {
    "description": "Demo string chosen to show Welsh consonant mutation",
    "placeholders": {
      "count": {
        "type": "int",
        "format": "decimalPattern"
      }
    }
  },
  "shared_by": "{sharerGender, select, female{{name} shared this} male{{name} shared this} other{{name} shared this}}",
  "@shared_by": {
    "description": "Gender-aware attribution line",
    "placeholders": {
      "sharerGender": {
        "type": "String"
      },
76 lines total — download for the full file.

Specifications

Format
Flutter Application Resource Bundle (JSON)
Locale
en
Plural Messages
4
Select Messages
1
Categories
one, other
Placeholder Types
int (decimalPattern, compactLong), String, DateTime
Metadata
@key blocks
Seed
20260807
Wave
p7
Line Endings
LF

Testing contract

Expected to pass
Scenario
Run flutter gen-l10n over this bundle (or parse the JSON) and format each plural message across every category boundary.
Expected result
gen_l10n produces one method per key with the declared argument types, and the formatted output matches the 2-way branch for en; a bundle missing a category the locale needs falls back to 'other' silently.

What is a .arb file?

An ARB file (.arb, Application Resource Bundle) is a JSON-based localization format used by Flutter and Google tools. Alongside each key's translated string it stores metadata in a matching @key object — a description and typed placeholders — and uses ICU message syntax with {name} placeholders and plural/select rules.

How to use this file

Use an example .arb file to test Flutter's gen-l10n pipeline, ARB editors and converters, and ICU message-syntax parsers, or to exercise placeholder and plural handling.

How to use this file for testing

“Flutter ARB — ICU plurals and typed placeholders (English)” is a deterministic Novus Examples fixture for Internationalization, Localization catalogs, JSON parsing. Parallel text and accented, multi-script content — for testing translation pipelines, Unicode handling, and localization tooling.

Documented properties for this file: seed 20260807 · LF · Flutter Application Resource Bundle (JSON). Compare results against paired or grouped companions on this page when present (clean↔damaged, searchable↔scanned, or format twins) so scores stay reproducible across runs.

Download the file once, keep the path stable in CI or local scripts, and treat the spec table as the contract: dimensions, seeds, field lists, and roles are intentional. Corrupt or invalid samples are labelled as such — expect parsers to fail loudly rather than silently accept them.

Translation-catalog fixtures carry the same message set across formats, each with its native placeholder syntax. Test your i18n loader, catalog converter, or translation-memory tool, and use the RTL and CJK variants to check bidirectional text and Unicode handling.

Load the catalog with your i18n framework and verify placeholder interpolation and plural handling; the RTL and CJK variants exercise bidirectional text and font fallback.

Code examples

import json

data = json.load(open("app_en.arb", encoding="utf-8"))
msgs = {k: v for k, v in data.items() if not k.startswith("@")}
print(len(msgs), "messages")

Generated by generation/localization_p7.py. Free for any use, no attribution required — license.