tr property

String get tr

Implementation

String get tr {
  final locale = Get.locale;
  // Returns the key if locale is null.
  if (locale == null) return this;

  final translation = _resolveTranslationFor(locale);
  if (translation != null) return translation;

  final fallback = Get.fallbackLocale;
  if (fallback != null) {
    return _resolveTranslationFor(fallback) ?? this;
  }
  // If there is no corresponding language or corresponding key, return
  // the key.
  return this;
}