MessageExtraction class
A particular message extraction run.
This encapsulates all the state required for message extraction so that it can be run inside a persistent process.
Constructors
Properties
- allowEmbeddedPluralsAndGenders ↔ bool
-
Are plural and gender expressions required to be at the top level
of an expression, or are they allowed to be embedded in string literals.
getter/setter pair
- descriptionRequired ↔ bool
-
getter/setter pair
- examplesRequired ↔ bool
-
Are examples required on all messages.
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasWarnings → bool
-
Were there any warnings or errors in extracting messages.
no setter
- includeSourceText ↔ bool
-
Whether to include source_text in messages
getter/setter pair
- onMessage ↔ OnMessage
-
What to do when a message is encountered, defaults to print.
getter/setter pair
- origin ↔ String?
-
An arbitrary string describing where the source code came from. Most
obviously, this could be a file path. We use this when reporting
invalid messages.
getter/setter pair
- root ↔ CompilationUnit
-
The root of the compilation unit, and the first node we visit. We hold
on to this for error reporting, as it can give us line numbers of other
nodes.
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- suppressLastModified ↔ bool
-
If this is true, the @@last_modified entry is not output.
getter/setter pair
- suppressMetaData ↔ bool
-
If this is true, no translation meta data is written
getter/setter pair
- suppressWarnings ↔ bool
-
If this is true, print warnings for skipped messages. Otherwise, warnings
are suppressed.
getter/setter pair
-
warnings
↔ List<
String> -
This accumulates a list of all warnings/errors we have found. These are
saved as strings right now, so all that can really be done is print and
count them.
getter/setter pair
- warningsAreErrors ↔ bool
-
If this is true, then treat all warnings as errors.
getter/setter pair
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
parseContent(
String fileContent, String filepath, [bool transformer = false]) → Map< String, MainMessage> -
Parse the source of the Dart program from a file with content
fileContent
and pathpath
and return a Map from message names toIntlMessage
instances. -
parseFile(
File file, [bool transformer = false]) → Map< String, MainMessage> -
Parse the source of the Dart program file
file
and return a Map from message names toIntlMessage
instances. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited