intl_translation_format library

Classes

ArbFormat
BasicTranslatedMessage
A TranslatedMessage that just uses the name as the id.
BinaryFileData
File data that is stored as bytes
CaseFormat
CaseFormat is for formatting strings into a different case.
CatalogTranslatedMessage
A TranslatedMessage that just uses the name as the id and knows how to look up its original messages inside a TranslationCatalog.
ComplexMessage
Abstract class for messages with internal structure, representing the main Intl.message call, plurals, and genders.
CompositeMessage
This represents a message chunk that is a list of multiple sub-pieces, each of which is in turn a Message.
ExtractArgParser
ExtractConfig
FileData
File data that can be stored in text or binary See related StringFileData, BinaryFileData
FileProvider
File abstraction that can be read and written [...]
Gender
Represents a message send of Intl.gender inside a message that is to be internationalized. This corresponds to an ICU message syntax "select" with "male", "female", and "other" as the possible options.
GenerateArgParser
GenerationConfig
IcuMainMessage
A main message generated from a icu string. The arguments are extracted from the message instead from the dart functions
IcuMessage
A message generated from a icu string. The arguments are added to the parent from the message instead from the dart functions
LiteralString
Represents a simple constant string with no dynamic elements.
LocalFile
A reference to a file on the file system.
MainMessage
Message
An abstract superclass for Intl.message/plural/gender calls in the program's source text. We assemble these into objects that can be used to write out some translation format and can also print themselves into code.
MessagesForLocale
MonoLingualFormat
MultiLingualFormat
Plural
ReadableFile
File abstraction that can be read
Select
Represents a message send of Intl.select inside a message that is to be internationalized. This corresponds to an ICU message syntax "select" with arbitrary options.
SingleBinaryLanguageFormat
StringFileData
File data that is stored as text
SubMessage
An abstract class to represent sub-sections of a message, primarily plurals and genders.
TranslationArgParser
TranslationCatalog
Catalog that stores all translation messages
TranslationConfig
Configuration for a traslation catalog. Defined as a yaml file
TranslationFormat<T extends FileData>
TranslationTemplate
Catalog that stores all message templates.
VariableSubstitution
Represents an interpolation of a variable value in a message. We expect this to be specified as an index into the list of variables, or else as the name of a variable that exists in arguments and we will compute the variable name or the index based on the value of the other.
WritableFile
File abstraction that can be written
XliffFormat

Constants

jsonEncoder → const JsonCodec
const JsonCodec()

Properties

defaultFormats Map<String, TranslationFormatBuilder>
Translation file formats officially supported
final
xliffFormats Map<String, TranslationFormatBuilder>
final

Functions

attributesForVersion(XliffVersion version) Map<String, String>
generateTemplate(TranslationTemplate template, XliffVersion version) String
localeFromName(String fileName, String baseName) String
messageToIcuString(Message message) String
Return a version of the message string with with ICU parameters "{variable}" rather than Dart interpolations "$variable".
recreateIntlObjects(String id, dynamic data) BasicTranslatedMessage
Regenerate the original IntlMessage objects from the given data. For things that are messages, we expect id not to start with "@" and data to be a String. For metadata we expect id to start with "@" and data to be a Map or null. For metadata we return null.

Enums

Case
FileDataType
XliffVersion

Typedefs

TranslationFormatBuilder = TranslationFormat<FileData> Function()

Exceptions / Errors

BadFormatException
IntlMessageExtractionException
Exception thrown when we cannot process a message properly.
UnsupportedFormatException