IcuMainMessage class

A main message generated from a icu string. The arguments are extracted from the message instead from the dart functions

Inheritance

Constructors

IcuMainMessage(String icuString, [String name])
factory

Properties

arguments List<String>
The arguments list from the Intl.message call.
read / write, inherited
attributeNames List<String>
The parameters that the Intl.message call may provide.
read-only, inherited
dartMessageName String
Return the message name we would use for this when doing Dart code generation, e.g. "Intl.plural".
read-only, inherited
description String
The description provided in the Intl.message call.
read / write, inherited
endPosition int
The position in the source at which this message ends.
read / write, inherited
examples Map<String, dynamic>
The examples from the Intl.message call
read / write, inherited
hashCode int
The hash code for this object. [...]
read-only, inherited
hasName bool
Does this message have an assigned name.
read-only, inherited
icuMessageName String
Return the name of the message type, as it will be generated into an ICU-type format. e.g. choice, select
read-only, inherited
id String
A placeholder for any other identifier that the translation format may want to use.
read / write, inherited
jsonTranslations Map<String, Object>
read / write, inherited
locale String
The locale argument from the Intl.message call
read / write, inherited
meaning String
A field to disambiguate two messages that might have exactly the same text. The two messages will also need different names, but this can be used by machine translation tools to distinguish them.
read / write, inherited
messagePieces List<Message>
All the pieces of the message. When we go to print, these will all be expanded appropriately. The exact form depends on what we're printing it for See expanded, toCode.
read / write, inherited
name String
If the message was not given a name, we use the entire message string as the name.
read / write, inherited
parent Message
All Messages except a MainMessage are contained inside some parent, terminating at an Intl.message call which supplies the arguments we use for variable substitutions.
read / write, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
skip bool
Whether extraction skip outputting this message. [...]
read / write, inherited
sourcePosition int
The position in the source at which this message starts.
read / write, inherited
translations Map<String, String>
When generating code, we store translations for each locale associated with the original message.
read / write, inherited

Methods

addPieces(List<Object> messages) → void
inherited
addTranslation(String locale, Message translated) → void
Record the translation for this message in the given locale, after suitably escaping it.
inherited
checkArgs(NamedExpression args, List<String> parameterNames) bool
Verify that the args argument matches the method parameters and isn't, e.g. passing string names instead of the argument values.
inherited
checkValidity(MethodInvocation node, List arguments, String outerName, FormalParameterList outerArgs, {bool nameAndArgsGenerated = false, bool examplesRequired = false}) String
Verify that this looks like a correct Intl.message invocation.
inherited
escapeAndValidateString(String value) String
Escape the string for use in generated Dart code.
inherited
expanded([Function f = _nullTransform]) String
Return the full message, with any interpolation expressions transformed by f and all the results concatenated. The chunk argument to f may be either a String, an int or an object representing a more complex message entity. See messagePieces.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toCode() String
Return a string representation of this message for use in generated Dart code.
inherited
toCodeForLocale(String locale, String name) String
Generate code for this message, expecting it to be part of a map keyed by name with values the function that calls Intl.message.
inherited
toJson() Object
Return a JSON-storable representation of this message which can be interpolated at runtime.
inherited
toJsonForLocale(String locale) → dynamic
Return a JSON string representation of this message.
inherited
toOriginalCode({bool includeDesc = true, dynamic includeExamples = true}) String
Create a string that will recreate this message, optionally including the compile-time only information desc and examples.
inherited
toString() String
A string representation of this object. [...]
inherited
turnInterpolationBackIntoStringForm(Message message, dynamic chunk) → dynamic
inherited
validate() → void
Verify that a constructed message is valid. [...]
inherited
validateDescription() → void
inherited

Operators

operator ==(Object other) bool
The equality operator. [...]
inherited
operator [](String attributeName) → dynamic
The AST node will have the attribute names as strings, so we translate between those and the fields of the class.
inherited
operator []=(String attributeName, dynamic value) → void
The AST node will have the attribute names as strings, so we translate between those and the fields of the class.
inherited