t method
Implementation
String t(
DVTranslationKey key, {
Map<String, String> args = const <String, String>{},
LocaleTag? locale,
bool strict = false,
}) {
final selected = locale ?? _currentLocale;
final catalog = _catalogs[selected.value];
final template = catalog?.messages[key];
if (template == null) {
if (strict) {
throw StateError(
'Missing Dartvel translation "${key.value}" for ${selected.value}.',
);
}
return key.value;
}
return _interpolate(template, args);
}