JsonMessageGeneration class
- Inheritance
-
- Object
- MessageGeneration
- DataMapMessageGeneration
- JsonMessageGeneration
- Implementers
Constructors
Properties
-
allLocales
↔ Set<
String> -
A list of all the locales for which we have translations. Code that does
the reading of translations should add to this.
getter/setter pairinherited
- closing → String
-
Constant string used in generateMainImportFile as the end of the file.
no setterinherited
- codegenMode ↔ String?
-
The mode to generate in - either 'release' or 'debug'.
getter/setter pairinherited
- extraImports → String
-
We import the main file so as to get the shared code to evaluate
the JSON data.
no setterinherited
- flutterImportPath ↔ String?
-
If the import path for flutter is not package:flutter, modify the
flutterImportPath variable to change the import directives in the
generated code. This is useful to mock out Flutter during tests since
package:flutter cannot be imported from Dart VM.
getter/setter pairinherited
- flutterPrologue → String
-
Constant string used in generateFlutterImportFile for the beginning of
the file.
no setterinherited
- generatedFilePrefix ↔ String?
-
If we have more than one set of messages to generate in a particular
directory we may want to prefix some to distinguish them.
getter/setter pairinherited
- generatedImportPath ↔ String
-
If the path to the generated files is something other than the current
directory, update the generatedImportPath variable to change the import
directives in the generated code.
getter/setter pairinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- intlImportPath ↔ String
-
If the import path following package: is something else, modify the
intlImportPath variable to change the import directives in the generated
code.
getter/setter pairinherited
- localesClosing → String
-
Constant string used in generateLocalesImportFile as the end of the
file.
no setterinherited
- localesPrologue → String
-
Constant string used in generateLocalesImportFile for the beginning of
the file.
no setterinherited
- mainPrologue → String
-
Constant string used in generateMainImportFile for the beginning of the
file.
no setterinherited
- messagesDeclaration → String
-
no setterinherited
- nullSafety ↔ bool
-
Whether to generate null safe code instead of legacy code.
getter/setter pairinherited
- output ↔ StringBuffer
-
Holds the generated translations.
getter/setter pairinherited
- package ↔ String?
-
What is the path to the package for which we are generating.
getter/setter pairinherited
- releaseMode → bool
-
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- useDeferredLoading ↔ bool
-
Should we use deferred loading for the generated libraries.
getter/setter pairinherited
Methods
-
clearOutput(
) → void -
inherited
-
contentForLocale(
String basicLocale, Iterable< TranslatedMessage> translations) → String -
Generate a string that contains the dart code
with the
translations
inlocale
.inherited -
generateFlutterImportFile(
) → String -
inherited
-
generateIndividualMessageFile(
String basicLocale, Iterable< TranslatedMessage> translations, String targetDir) → void -
Generate a file <
generated_file_prefix
>messages<locale
>.dart for thetranslations
inlocale
and put it intargetDir
.inherited -
generateLocalesImportFile(
) → String -
This section generates the messages_all_locales.dart file based on the
list of allLocales.
inherited
-
generateMainImportFile(
{bool flutter = false}) → String -
This section generates the messages_all.dart file.
inherited
-
importForGeneratedFile(
String file) → String -
Given a base file, return the file prefixed with the path to import it.
By default, that is in the current directory, but if generatedImportPath
has been set, then use that as a prefix.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
overrideLookup(
) → String -
inherited
-
prologue(
String locale) → String -
generateIndividualMessageFile for the beginning of the file,
parameterized by
locale
.inherited -
toString(
) → String -
A string representation of this object.
inherited
-
writeTranslations(
Iterable< TranslatedMessage> usableTranslations, String locale) → void -
Write out the translated forms.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited