has method
Checks if a translation key exists.
key: The translation key.locale: Locale to check; uses current if null.namespace: Namespace to search in.- Returns: True if the key exists.
Implementation
@override
bool has(String key, {String? locale, String? namespace}) {
final loc = locale ?? _currentLocale;
final ns = namespace ?? '';
return _getTranslation(key, loc, ns) != null ||
_getTranslation(key, loc, '') != null ||
(loc != _fallbackLocale &&
(_getTranslation(key, _fallbackLocale, ns) != null ||
_getTranslation(key, _fallbackLocale, '') != null));
}