translate method

String translate(
  1. String text
)

Implementation

String translate(String text) {
  String? translationText;
  if (locale.toLowerCase().trim() == "en") {
    translationText = en[text];
  } else if (locale.toLowerCase().trim() == "ar") {
    translationText = ar[text];
  }
  return translationText ?? text;
}