FileTranslationLoader class

Loads translation files from JSON, YAML or XML format

Inheritance
Implemented types
Implementers

Constructors

FileTranslationLoader({String fallbackFile = "en", String basePath = "assets/flutter_i18n", bool useCountryCode = false, bool useScriptCode = false, dynamic forcedLocale, dynamic decodeStrategies})

Properties

assetBundle AssetBundle
read / write
basePath String
final
decodeStrategies List<BaseDecodeStrategy>?
write-only
fallbackFile String
final
forcedLocale Locale?
Used to force the locale to load
write-onlyinherited
hashCode int
The hash code for this object.
read-onlyinherited
locale Locale?
Currently locale used by the library
read / writeinherited
runtimeType Type
A representation of the runtime type of the object.
read-onlyinherited
useCountryCode bool
final
useScriptCode bool
final

Methods

composeFileName() String
Compose the file name using the format languageCode_countryCode
findDeviceLocale() Future<Locale>
Return the device current locale
inherited
load() Future<Map>
Return the translation Map
override
loadFile(String fileName) Future<Map>
Load the fileName using one of the strategies provided
loadString(String fileName, String extension) Future<String>
Load the file using the AssetBundle rootBundle
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited