computeSourceHashes function
Translation freshness — the change-half of the sync loop.
Each translation records the source_hash (per dialect/spec/source_hash.md)
of the source value it was written against. When the English source later
changes, the stored hash no longer matches and the translation is stale
— it needs re-translating or re-reviewing. A translation with no stored
hash is untracked (provenance unknown), not stale: we only start
tracking from the moment a value is stamped, so adoption never floods a
project with false positives.
Provenance lives on the value, committed in the translation ARB. In Cloud
(v1.3) the same hash is a column on the translation row, carried by
push/pull — the contract is identical across local-only, self-host,
and Cloud.
{ key: sha256-16(source value) } for every source entry.
Implementation
/// `{ key: sha256-16(source value) }` for every source entry.
Map<String, String> computeSourceHashes(ArbFile source) => {
for (final e in source.entries) e.key: computeSourceHash(e.value),
};