retrieve method
Attempts to retrieve a value given Locale in options
, namespace
,
and key
.
key
cannot be null and it is split by I18NextOptions.keySeparator when creating a navigation path.
Returns null if not found.
Implementation
String? retrieve(
Locale locale,
String namespace,
String key,
I18NextOptions options,
) {
final keySeparator = options.keySeparator ?? '.';
final path = <Object>[
locale,
namespace,
...key.split(keySeparator),
];
final value = evaluate(path, _data);
return value is String ? value : null;
}