masteryLevelLabel function
- AppLocalizations l10n,
- String level
Localized display names for the mastery ramp defined in Mastery.levels.
The level values (unstarted/awareness/…/mastery) are persisted strings
and stay untranslated on the wire — only their presentation is localized.
Unknown levels fall back to the raw value so a level added later still
renders something rather than blank.
Distinct from the reviewStage* keys, which name the stages of a review
session rather than positions on the mastery ramp; the two sets overlap on
three words in English but are not interchangeable.
Call sites that render the level in all-caps (learning-path step tiles)
apply .toUpperCase() to the result.
Implementation
String masteryLevelLabel(AppLocalizations l10n, String level) =>
switch (level) {
'unstarted' => l10n.masteryLevelUnstarted,
'awareness' => l10n.masteryLevelAwareness,
'understanding' => l10n.masteryLevelUnderstanding,
'application' => l10n.masteryLevelApplication,
'evaluation' => l10n.masteryLevelEvaluation,
'mastery' => l10n.masteryLevelMastery,
_ => level,
};