ArbAdapter class
ARB-passthrough adapter. The only adapter Dialect ships in v1.0 —
every other platform (Apple .strings, Android strings.xml,
flat-json, icu-json) is parked for v1.1.
Two transforms happen during sync:
- Namespace filter. Only keys whose
@key.namespacemetadata appears in PlatformConfig.namespaces are included. An empty namespaces list disables the filter — every key passes. The namespace is always read from the source ARB's@keyblock: translation files don't carry@keymetadata by convention, so looking it up there would drop every translated key. Keys with no source-side namespace flow back through PreparedArb.keysMissingNamespace; keys whose namespace is set but not in the platform's allowlist flow through PreparedArb.keysExcludedByNamespace so sync can warn instead of silently truncating the output. - Metadata stripping. Source ARBs keep their
@keyblocks intact (Flutter'sgen_l10nreads them). Translation ARBs are key/value-only by convention; if a translation accidentally accumulated@keyblocks, the adapter strips them.
Output is always ArbWriter canonical form — that's the idempotency
contract (sync twice = same bytes). dialect check --fix reuses
the same writer, so a synced ARB run back through --fix is a no-op.
The adapter does not modify input ARBs. No "auto-fix" during
sync; that's dialect check --fix's job.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
encode(
ArbFile arb) → String - Render an ArbFile to canonical bytes via ArbWriter.
-
filenameFor(
String locale) → String -
Filename convention for v1.0:
app_<locale>.arb. Matches Flutter'sgen_l10ndefault. v1.1 will spec a configurable pattern underplatforms.<p>.filename_pattern. -
prepare(
ArbFile arb, {required PlatformConfig platform, required bool isSource, ArbFile? source}) → PreparedArb - Apply the namespace filter and strip translation metadata, returning a PreparedArb ready to hand to ArbWriter (plus diagnostics).