localizeExerciseMode function
- BuildContext context,
- ExerciseMode? mode
Localize the given exercise mode into text that can be displayed to the user
Implementation
String localizeExerciseMode(BuildContext context, ExerciseMode? mode) {
switch (mode) {
case ExerciseMode.none:
return context.sharedL10n.none;
case ExerciseMode.unloaded:
return context.sharedL10n.unloadedCycle;
case ExerciseMode.unloadedFullSpeed:
return context.sharedL10n.unloadedFullSpeed;
case ExerciseMode.loadedFullSpeed:
return context.sharedL10n.loadedFullSpeed;
case ExerciseMode.ecoCycle:
return context.sharedL10n.ecoExerciseCycle;
case null:
return context.sharedL10n.unknownExercise;
}
}