t method

String t(
  1. String key
)

Translate a key. Falls back to key itself if not found.

Implementation

String t(String key) {
  final langMap = translations[locale.languageCode];
  return langMap?[key] ?? translations['en']?[key] ?? key;
}