text method

String text(
  1. Locale locale, {
  2. bool markAsDefault = false,
  3. TextureIcons selectedIcon = TextureIcons.none,
})

Implementation

String text(
  Locale locale, {
  bool markAsDefault = false,
  TextureIcons selectedIcon = TextureIcons.none,
}) {
  String value = _(Language.fromCode(
    locale.languageCode,
    locale.countryCode,
  ));
  if (markAsDefault && Translation.i.defaultLocale == locale) {
    value = "$value (Default)";
  }
  if (!selectedIcon.isNone && Translation.i.locale == locale) {
    value = "$value ${selectedIcon.icon}";
  }
  return value;
}