localizeExerciseFrequency function

String localizeExerciseFrequency(
  1. BuildContext context,
  2. ExerciseFrequency? frequency
)

Localize the given exercise frequency into text that can be displayed to the user

Implementation

String localizeExerciseFrequency(
  BuildContext context,
  ExerciseFrequency? frequency,
) {
  switch (frequency) {
    case ExerciseFrequency.weekly:
      return context.sharedL10n.weekly;
    case ExerciseFrequency.biWeekly:
      return context.sharedL10n.biWeekly;
    case ExerciseFrequency.monthly:
      return context.sharedL10n.monthly;
    case null:
      return context.sharedL10n.unknownFrequency;
  }
}