retrieve method

String? retrieve(
  1. Locale locale,
  2. String namespace,
  3. String key,
  4. I18NextOptions options,
)

Attempts to retrieve a value given Locale in options, namespace, and key.

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;
}