Translate App into German
This commit is contained in:
@@ -13,7 +13,7 @@ class AvailableTournamentList extends StatelessWidget {
|
||||
padding: EdgeInsets.fromLTRB(24, 0, 24, 0),
|
||||
child: Column(
|
||||
children: [
|
||||
Row(children: [Text("Available Tournaments")]),
|
||||
const Row(children: [Text('Verfügbare Turniere')]),
|
||||
SizedBox(
|
||||
width: double.infinity,
|
||||
height: 350,
|
||||
@@ -40,18 +40,21 @@ class TournamentListFutureBuilder extends StatelessWidget {
|
||||
future: provider.ensureTournamentsLoaded(),
|
||||
builder: (context, snapshot) {
|
||||
final list = provider.availableTournaments;
|
||||
print(list);
|
||||
if (snapshot.connectionState == ConnectionState.waiting &&
|
||||
list.isEmpty) {
|
||||
return Center(child: CircularProgressIndicator());
|
||||
}
|
||||
|
||||
if (snapshot.hasError && list.isEmpty) {
|
||||
return Center(child: Text('Error: ${snapshot.error}'));
|
||||
return Center(
|
||||
child: Text(
|
||||
'Fehler: ${snapshot.error.toString().replaceFirst('Exception: ', '')}',
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
if (list.isEmpty) {
|
||||
return Center(child: Text('No tournaments found'));
|
||||
return const Center(child: Text('Keine Turniere gefunden'));
|
||||
}
|
||||
|
||||
return ListView.builder(
|
||||
|
||||
@@ -20,7 +20,10 @@ class _MyTeamsWidgetState extends State<MyTeamsWidget> {
|
||||
}
|
||||
|
||||
void _loadMyTeams() {
|
||||
_myTeamsFuture = Provider.of<TeamProvider>(context, listen: false).getUserTeams();
|
||||
_myTeamsFuture = Provider.of<TeamProvider>(
|
||||
context,
|
||||
listen: false,
|
||||
).getUserTeams();
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -33,13 +36,19 @@ class _MyTeamsWidgetState extends State<MyTeamsWidget> {
|
||||
}
|
||||
|
||||
if (snapshot.hasError) {
|
||||
return Center(child: Text('Error: ${snapshot.error}'));
|
||||
return Center(
|
||||
child: Text(
|
||||
'Fehler: ${snapshot.error.toString().replaceFirst('Exception: ', '')}',
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
final teams = snapshot.data ?? [];
|
||||
if (teams.isEmpty) {
|
||||
return const Center(
|
||||
child: Text('You are not in any teams yet\nJoin teams from the All Teams tab'),
|
||||
child: Text(
|
||||
'Du bist noch in keinem Team.\nTritt einem Team im Tab Alle Teams bei.',
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -53,11 +62,13 @@ class _MyTeamsWidgetState extends State<MyTeamsWidget> {
|
||||
}
|
||||
|
||||
Widget _buildTeamCard(Team team) {
|
||||
final memberCountText = team.memberCount != null
|
||||
? '${team.memberCount}/4 members'
|
||||
: 'No members';
|
||||
final description = team.description.isEmpty ? 'No description' : team.description;
|
||||
|
||||
final memberCountText = team.memberCount != null
|
||||
? '${team.memberCount}/4 Mitglieder'
|
||||
: 'Keine Mitglieder';
|
||||
final description = team.description.isEmpty
|
||||
? 'Keine Beschreibung'
|
||||
: team.description;
|
||||
|
||||
return Card(
|
||||
margin: const EdgeInsets.only(bottom: 12),
|
||||
child: ListTile(
|
||||
@@ -79,16 +90,16 @@ class _MyTeamsWidgetState extends State<MyTeamsWidget> {
|
||||
final confirmed = await showDialog<bool>(
|
||||
context: context,
|
||||
builder: (context) => AlertDialog(
|
||||
title: const Text('Leave Team?'),
|
||||
content: Text('Leave "${team.name}"?'),
|
||||
title: const Text('Team verlassen?'),
|
||||
content: Text('Soll "${team.name}" verlassen werden?'),
|
||||
actions: [
|
||||
TextButton(
|
||||
onPressed: () => Navigator.pop(context, false),
|
||||
child: const Text('Cancel'),
|
||||
child: const Text('Abbrechen'),
|
||||
),
|
||||
TextButton(
|
||||
onPressed: () => Navigator.pop(context, true),
|
||||
child: const Text('Leave', style: TextStyle(color: Colors.red)),
|
||||
child: const Text('Verlassen', style: TextStyle(color: Colors.red)),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -96,18 +107,25 @@ class _MyTeamsWidgetState extends State<MyTeamsWidget> {
|
||||
|
||||
if (confirmed == true && mounted) {
|
||||
try {
|
||||
await Provider.of<TeamProvider>(context, listen: false).leaveTeam(team.id);
|
||||
await Provider.of<TeamProvider>(
|
||||
context,
|
||||
listen: false,
|
||||
).leaveTeam(team.id);
|
||||
if (mounted) {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
const SnackBar(content: Text('Left team')),
|
||||
);
|
||||
ScaffoldMessenger.of(
|
||||
context,
|
||||
).showSnackBar(const SnackBar(content: Text('Team verlassen')));
|
||||
_loadMyTeams();
|
||||
setState(() {});
|
||||
}
|
||||
} catch (e) {
|
||||
if (mounted) {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(content: Text('Error: $e')),
|
||||
SnackBar(
|
||||
content: Text(
|
||||
'Fehler: ${e.toString().replaceFirst('Exception: ', '')}',
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ class _MyTournamentsCarouselState extends State<MyTournamentsCarousel> {
|
||||
const Padding(
|
||||
padding: EdgeInsets.fromLTRB(16, 16, 16, 8),
|
||||
child: Text(
|
||||
'My Tournaments',
|
||||
'Meine Turniere',
|
||||
style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold),
|
||||
),
|
||||
),
|
||||
@@ -58,7 +58,7 @@ class _MyTournamentsCarouselState extends State<MyTournamentsCarousel> {
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
const Text(
|
||||
'No tournaments found',
|
||||
'Keine Turniere gefunden',
|
||||
style: TextStyle(fontSize: 16, color: Colors.grey),
|
||||
),
|
||||
],
|
||||
@@ -77,7 +77,7 @@ class _MyTournamentsCarouselState extends State<MyTournamentsCarousel> {
|
||||
const Padding(
|
||||
padding: EdgeInsets.fromLTRB(16, 16, 16, 8),
|
||||
child: Text(
|
||||
'My Tournaments',
|
||||
'Meine Turniere',
|
||||
style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold),
|
||||
),
|
||||
),
|
||||
@@ -162,13 +162,13 @@ class _TournamentCard extends StatelessWidget {
|
||||
const SizedBox(width: 4),
|
||||
Text(
|
||||
tournament.isRegistrationOpen
|
||||
? 'Registration Open'
|
||||
: 'Registration Closed',
|
||||
? 'Anmeldung offen'
|
||||
: 'Anmeldung geschlossen',
|
||||
style: const TextStyle(fontSize: 14),
|
||||
),
|
||||
const Spacer(),
|
||||
Text(
|
||||
'${tournament.currentTeamAmount}/${tournament.maxTeamAmount} teams',
|
||||
'${tournament.currentTeamAmount}/${tournament.maxTeamAmount} Teams',
|
||||
style: const TextStyle(fontSize: 14),
|
||||
),
|
||||
],
|
||||
|
||||
@@ -14,11 +14,11 @@ class _ProfileWidgetState extends State<ProfileWidget> {
|
||||
Widget build(BuildContext context) {
|
||||
return Consumer<AuthProvider>(
|
||||
builder: (context, provider, child) {
|
||||
final username = provider.username ?? "Unknown User";
|
||||
final avatarText = username.length >= 3
|
||||
? username.substring(0, 3).toUpperCase()
|
||||
final username = provider.username ?? 'Unbekannter Benutzer';
|
||||
final avatarText = username.length >= 3
|
||||
? username.substring(0, 3).toUpperCase()
|
||||
: username.toUpperCase();
|
||||
|
||||
|
||||
return Column(
|
||||
children: [
|
||||
SizedBox(
|
||||
|
||||
@@ -18,21 +18,27 @@ class TeamsListWidget extends StatelessWidget {
|
||||
builder: (context, snapshot) {
|
||||
final teams = provider.teams;
|
||||
|
||||
if (snapshot.connectionState == ConnectionState.waiting && teams.isEmpty) {
|
||||
if (snapshot.connectionState == ConnectionState.waiting &&
|
||||
teams.isEmpty) {
|
||||
return const Center(child: CircularProgressIndicator());
|
||||
}
|
||||
|
||||
if (snapshot.hasError && teams.isEmpty) {
|
||||
return Center(child: Text('Error: ${snapshot.error}'));
|
||||
return Center(
|
||||
child: Text(
|
||||
'Fehler: ${snapshot.error.toString().replaceFirst('Exception: ', '')}',
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
if (teams.isEmpty) {
|
||||
return const Center(child: Text('No teams found'));
|
||||
return const Center(child: Text('Keine Teams gefunden'));
|
||||
}
|
||||
|
||||
return ListView.builder(
|
||||
itemCount: teams.length,
|
||||
itemBuilder: (context, index) => TeamListItem(team: teams[index]),
|
||||
itemBuilder: (context, index) =>
|
||||
TeamListItem(team: teams[index]),
|
||||
);
|
||||
},
|
||||
);
|
||||
@@ -49,11 +55,13 @@ class TeamListItem extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final memberCountText = team.memberCount != null
|
||||
? '${team.memberCount}/4 members'
|
||||
: 'No members';
|
||||
final description = team.description.isEmpty ? 'No description' : team.description;
|
||||
|
||||
final memberCountText = team.memberCount != null
|
||||
? '${team.memberCount}/4 Mitglieder'
|
||||
: 'Keine Mitglieder';
|
||||
final description = team.description.isEmpty
|
||||
? 'Keine Beschreibung'
|
||||
: team.description;
|
||||
|
||||
return Card(
|
||||
margin: const EdgeInsets.only(bottom: 12),
|
||||
child: ListTile(
|
||||
@@ -66,11 +74,11 @@ class TeamListItem extends StatelessWidget {
|
||||
trailing: PopupMenuButton(
|
||||
icon: const Icon(Icons.more_vert),
|
||||
itemBuilder: (context) => [
|
||||
const PopupMenuItem(value: 'join', child: Text('Join Team')),
|
||||
const PopupMenuItem(value: 'edit', child: Text('Edit Team')),
|
||||
const PopupMenuItem(value: 'join', child: Text('Team beitreten')),
|
||||
const PopupMenuItem(value: 'edit', child: Text('Team bearbeiten')),
|
||||
const PopupMenuItem(
|
||||
value: 'delete',
|
||||
child: Text('Delete Team', style: TextStyle(color: Colors.red)),
|
||||
child: Text('Team löschen', style: TextStyle(color: Colors.red)),
|
||||
),
|
||||
],
|
||||
onSelected: (value) async {
|
||||
@@ -98,7 +106,7 @@ class TeamListItem extends StatelessWidget {
|
||||
await Provider.of<TeamProvider>(context, listen: false).joinTeam(team.id);
|
||||
if (context.mounted) {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(content: Text('Joined ${team.name}!')),
|
||||
SnackBar(content: Text('Du bist ${team.name} beigetreten.')),
|
||||
);
|
||||
}
|
||||
} catch (e) {
|
||||
@@ -114,16 +122,18 @@ class TeamListItem extends StatelessWidget {
|
||||
final confirmed = await showDialog<bool>(
|
||||
context: context,
|
||||
builder: (context) => AlertDialog(
|
||||
title: const Text('Delete Team?'),
|
||||
content: Text('Delete "${team.name}"? This cannot be undone.'),
|
||||
title: const Text('Team löschen?'),
|
||||
content: Text(
|
||||
'Soll "${team.name}" gelöscht werden? Das kann nicht rückgängig gemacht werden.',
|
||||
),
|
||||
actions: [
|
||||
TextButton(
|
||||
onPressed: () => Navigator.pop(context, false),
|
||||
child: const Text('Cancel'),
|
||||
child: const Text('Abbrechen'),
|
||||
),
|
||||
TextButton(
|
||||
onPressed: () => Navigator.pop(context, true),
|
||||
child: const Text('Delete', style: TextStyle(color: Colors.red)),
|
||||
child: const Text('Löschen', style: TextStyle(color: Colors.red)),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -131,16 +141,23 @@ class TeamListItem extends StatelessWidget {
|
||||
|
||||
if (confirmed == true && context.mounted) {
|
||||
try {
|
||||
await Provider.of<TeamProvider>(context, listen: false).deleteTeam(team.id);
|
||||
await Provider.of<TeamProvider>(
|
||||
context,
|
||||
listen: false,
|
||||
).deleteTeam(team.id);
|
||||
if (context.mounted) {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
const SnackBar(content: Text('Team deleted')),
|
||||
);
|
||||
ScaffoldMessenger.of(
|
||||
context,
|
||||
).showSnackBar(const SnackBar(content: Text('Team gelöscht')));
|
||||
}
|
||||
} catch (e) {
|
||||
if (context.mounted) {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(content: Text('Error: $e')),
|
||||
SnackBar(
|
||||
content: Text(
|
||||
'Fehler: ${e.toString().replaceFirst('Exception: ', '')}',
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,21 +9,21 @@ class ThemeSelectorWidget extends StatelessWidget {
|
||||
final List<DropdownMenuItem<AppThemeOption>> dropdownElements = [
|
||||
const DropdownMenuItem(
|
||||
value: AppThemeOption.lightBlue,
|
||||
child: Text("Light Blue"),
|
||||
child: Text('Helles Blau'),
|
||||
),
|
||||
const DropdownMenuItem(
|
||||
value: AppThemeOption.darkPurple,
|
||||
child: Text("Dark Purple"),
|
||||
child: Text('Dunkles Lila'),
|
||||
),
|
||||
const DropdownMenuItem(
|
||||
value: AppThemeOption.lightMint,
|
||||
child: Text("Light Mint"),
|
||||
child: Text('Helles Mint'),
|
||||
),
|
||||
const DropdownMenuItem(
|
||||
value: AppThemeOption.darkAmber,
|
||||
child: Text("Dark Amber"),
|
||||
child: Text('Dunkles Bernstein'),
|
||||
),
|
||||
const DropdownMenuItem(value: AppThemeOption.system, child: Text("System")),
|
||||
const DropdownMenuItem(value: AppThemeOption.system, child: Text('System')),
|
||||
];
|
||||
|
||||
@override
|
||||
@@ -39,7 +39,7 @@ class ThemeSelectorWidget extends StatelessWidget {
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text("Theme"),
|
||||
const Text('Design'),
|
||||
SizedBox(
|
||||
width: 250,
|
||||
child: DropdownButtonFormField<AppThemeOption>(
|
||||
|
||||
Reference in New Issue
Block a user