DialectProject class

A loaded Dialect project: parsed dialect.yaml plus the source ARB and every translation ARB.

Most v1.0 commands (check, sync, status) take a DialectProject as input and never touch the filesystem themselves. The two exceptions are init (creates the structure) and the report formatter (re-reads a file when computing a file:line for an orphan).

Constructors

DialectProject({required String root, required DialectConfig config, required ArbFile source, required Map<String, ArbFile> translations, Glossary? glossary})

Properties

config DialectConfig
Parsed dialect/dialect.yaml.
final
glossary Glossary
Parsed dialect/glossary.yaml. Empty (but non-null) when the file is missing — the glossary check rule no-ops in that case.
final
hashCode int
The hash code for this object.
no setterinherited
root String
Repo-relative or absolute path to the directory containing dialect/. path.join(root, 'dialect', …) is the rule.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
source ArbFile
Parsed dialect/source/<source_locale>.arb.
final
translations Map<String, ArbFile>
Parsed dialect/translations/<locale>.arb for every configured target locale. Keys may be missing if a translation file doesn't exist yet — the check rule `missing_keys` surfaces that.
final

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

load(String root) DialectProject
Load the project rooted at root (the directory that contains dialect/). Throws FileSystemException if the directory layout is wrong; throws FormatException from the parsers if any file is malformed.