L10n class
Manages resources required for localization.
For each Locale, place the yaml file in the directory specified by
I18nEnvironment.l10nPaths.
The file name becomes the identifier returned by
Locale.toLanguageTag and is normalized by Intl.canonicalizedLocale
.
This class is automatically created during the load of L10nDelegate and loads each resource.
Properties
Methods
-
containsMessageKey(
String key) → bool -
Returns true if
key
is defined in the yaml file. -
lookup(
String key, {Map< String, Object> ? namedParameters}) → String -
Returns a string specified by
key
from the loaded yaml file. -
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
Static Methods
-
containsKey(
{required BuildContext context, required String key}) → bool -
Returns true if
key
is defined in the yaml file. -
fromAssets(
{required Locale locale, required List< String> paths, AssetBundle? assetBundle}) → Future<L10n> - Load the yaml file corresponding to Locale from the asset.