implemented comprehensive accessibility (A11y) support across the app
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
import '../../extensions/date_time.dart';
|
||||
|
||||
/// Zentrale deutschsprachige Screenreader-Labels. Single Source of Truth für
|
||||
/// alle `Semantics`/`semanticLabel`/`tooltip`-Texte – und der eine Punkt, an
|
||||
/// dem später echtes l10n andockt (die App ist aktuell fest auf `de`).
|
||||
abstract final class A11yLabels {
|
||||
// Zustände
|
||||
static const loading = 'Lädt';
|
||||
static const downloadingFile = 'Lädt herunter';
|
||||
|
||||
// Chat
|
||||
static const messageRead = 'Gelesen';
|
||||
static const messageSent = 'Gesendet';
|
||||
static const unread = 'Ungelesen';
|
||||
static const favorite = 'Favorit';
|
||||
static const draft = 'Entwurf';
|
||||
static const yourReaction = 'deine Reaktion';
|
||||
|
||||
// Bilder
|
||||
static const profilePicture = 'Profilbild';
|
||||
static const groupPicture = 'Gruppenbild';
|
||||
static const roomPlan = 'Raumplan der Schule als Grafik';
|
||||
|
||||
// Stundenplan
|
||||
static const cancelled = 'Ausfall';
|
||||
static const breakTime = 'Pause';
|
||||
static const allDay = 'Ganztägig';
|
||||
|
||||
/// Beschreibt eine Stundenplan-Kachel für den Screenreader, z.B.
|
||||
/// „Mathe, Raum 101, 08:00–08:45, Ausfall". Zeilenumbrüche in [location]
|
||||
/// (Raum/Lehrer stehen dort mehrzeilig) werden zu Trennern geglättet.
|
||||
static String appointmentLabel({
|
||||
required String subject,
|
||||
required String location,
|
||||
required DateTime start,
|
||||
required DateTime end,
|
||||
required bool crossedOut,
|
||||
}) {
|
||||
final parts = <String>[subject];
|
||||
final loc = location.replaceAll('\n', ', ').trim();
|
||||
if (loc.isNotEmpty) parts.add(loc);
|
||||
parts.add('${start.formatHm()}–${end.formatHm()}');
|
||||
if (crossedOut) parts.add(cancelled);
|
||||
return parts.join(', ');
|
||||
}
|
||||
|
||||
/// „+3 weitere Termine" für die zusammengefasste Overflow-Kachel.
|
||||
static String moreAppointments(int count) => '+$count weitere Termine';
|
||||
}
|
||||
Reference in New Issue
Block a user