TranslationExport class
A written export, read back.
var export = await TranslationExport.read('build/translations');
for (var key in export.keys) {
var shot = key.representative;
if (shot == null) continue;
await service.attach(export.file(shot.image), key.id, shot.rect);
}
Constructors
-
TranslationExport({int version = translationExportVersion, String directory = '.', List<
ExportedCatalog> catalogs = const [], List<ExportedKey> keys = const [], ExportFindings findings = const ExportFindings(), bool measuredMaxLengths = false, List<String> maxLengthDevices = const []}) -
const
Properties
-
catalogs
→ List<
ExportedCatalog> -
final
- directory → String
-
Where it was read from — what file resolves against. Not serialized:
an export is movable, and a path baked into it would survive the move and
be wrong.
final
- findings → ExportFindings
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
-
keys
→ List<
ExportedKey> -
Every key, most-seen first, then declared-but-unseen.
final
-
maxLengthDevices
→ List<
String> -
The devices the probe measured on, sorted — the geometry every
ExportedMaxLength.measuredOn refers to.
final
- measuredMaxLengths → bool
-
Whether a max-length probe ran at all. False is "not measured", which a
reader must keep distinguishable from "measured and roomy" — absence of
a probe is not evidence of room.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
seen
→ Iterable<
ExportedKey> -
Every key that was actually seen on a screen.
no setter
- version → int
-
final
Methods
-
file(
String exportRelative) → File - Turns an export-relative path — ExportedShot.image — into a file.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, Object?> -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
-
operator [](
String id) → ExportedKey? -
The key with this
catalog/keyid, or null.
Static Methods
-
fromJson(
Map< String, Object?> json, {String directory = '.'}) → TranslationExport -
Decodes an already-parsed
keys.json. -
read(
String directory) → Future< TranslationExport> -
Reads the
keys.jsonindirectory.