translate method

String translate(
  1. String key
)

Implementation

String translate(String key) {
  String langCode = currentLocale.languageCode;
  return translations[langCode]?[key] ??
      translations[langCode]?[key.toLowerCase()] ??
      key;
}