intl_messages library

Classes

CountryInfo
A country info.
IntlBasicDictionary
A basic dictionary of common messages for an applicatin.
IntlFallbackLanguage
Defines the fallback language hierarchie.
IntlKey
Represents a internationalized key from a IntlMessages.
IntlLocale
Represents a locale, with language and region codes.
IntlMessageLookup
IntlMessages
Represents a message table with keys and values.
IntlMessagesLoader
Loader of IntlMessages with registered IntlResourceDiscover based into package and pathPrefix.
IntlResourceContent
A internationalized ResourceContent
IntlResourceDiscover
Internationalized resource discover. Identifies and loads available localized resource.
IntlResourceUri
A localized resource based in a Uri.
LocaleInitializer
Initializes the locale, including packages, and defines default locale using current system and platform defaults.
LocaleOption
LocalesManager
LocalizedMessage
Represents a message in a specif locale.
LocalizedMessages
A table of keys and messages.
Message
A message.
MessageBlock
MessageBlockBranch
MessageBuilder
Helper to build a message.
MessageValue
MessageVariable
Translator
Translator base class.
TranslatorCache
Base class for a Translator cache.
TranslatorInMemory
A Translator with a inn-memory set of translations.

Properties

allCountries List<CountryInfo>
A list with all the countries info.
final
allCountriesByCode Map<String, CountryInfo>
final
allCountriesByDialCode Map<int, CountryInfo>
final
allCountriesByName Map<String, CountryInfo>
final
messageIdiom String
no setter
messageLanguage String
no setter

Functions

allLocales() Map<String, String>
List with al known locales codes and names.
allLocalesCodes() List<String>
List will all locales codes.
createLocalesManager(InitializeLocaleFunction initializeLocaleFunction, [void onDefineLocale(String locale)?]) LocalesManager
formatDateRangeText(DateTime startTime, DateTime endTime, bool hasTimePicker, [IntlLocale? locale]) String
Gets a date range, startTime and endTime, and formats it's texts with locale, trying to use less characters.
getCountryInfo({String? countryCode, int? dialCode, String? countryName}) CountryInfo?
Returns a CountryInfo by countryCode, dialCode or countryName.
getCurrentLocale() String
Returns the current locale.
getDateFormat_yMMMd([IntlLocale? locale]) → DateFormat
Returns DateFormat for locale and skeleton yMMMd.
getDateFormat_yMMMMd([IntlLocale? locale]) → DateFormat
Returns DateFormat for locale and skeleton yMMMMd`.
getDateRangeTypeTitle(DateRangeType rangeType, [IntlLocale? locale, IntlLocale? localeFallback]) String?
Returns the localized title message for rangeType.
getFirstDayOfWeek([IntlLocale? locale]) → DateTimeWeekDay
Returns DateTimeWeekDay for locale.
getLoadedLocales() List<String>?
Returns a list of loaded locales.
getLocaleDateSymbols([IntlLocale? locale]) → DateSymbols?
A DateSymbols, with many information for locale
getLocaleName(String locale, {String? defaultName, bool nativeName = false, String? nativeLocale, bool preserveLatinNames = true}) String
Returns the name of a locale code.
getPossibleLocalesSequence(String locale) List<String>
Returns a list of possible locales sequence for best discovery priority
getSimilarLocales(String locale) List<String>
Returns a similar locale, usually for fallback discover.
getTimeFormatUsesAMPM([IntlLocale? locale]) bool
Returns true if locale us AMPM format.
isLoadedLocale(String locale, [bool def = false]) bool
Returns true if locale is loaded or def.
latinLanguages() List<String>
List of locales for latin languages.
messageIdiomByLocale(String locale) String
Returns the message for the word idiom. Useful to build language selectors.
messageLanguageByLocale(String locale) String
Returns the message for the word language. Useful to build language selectors.
replaceLocale(RegExp pattern, String path, String locale) String
Inserts the locale in a path using pattern as place holder.

Typedefs

InitializeLocaleFunction = Future<bool> Function(String locale)
IntlVariablesProvider = Map<String, dynamic> Function()
LocaleInitializeFunction = Future<bool> Function(String locale)
OnDefineLocale = void Function(String locale)
OnPreDefineLocale = Future<bool> Function(String locale)
TranslatorLogger = void Function(Object? o)
Translator logger.