Added localization for de & en
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import 'package:cabo_counter/data/game_session.dart';
|
||||
import 'package:cabo_counter/l10n/app_localizations.dart';
|
||||
import 'package:cabo_counter/utility/custom_theme.dart';
|
||||
import 'package:cabo_counter/views/round_view.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
@@ -31,7 +32,7 @@ class _ActiveGameViewState extends State<ActiveGameView> {
|
||||
Padding(
|
||||
padding: const EdgeInsets.fromLTRB(10, 10, 0, 0),
|
||||
child: Text(
|
||||
'Spieler:innen',
|
||||
AppLocalizations.of(context).players,
|
||||
style: CustomTheme.rowTitle,
|
||||
),
|
||||
),
|
||||
@@ -58,7 +59,7 @@ class _ActiveGameViewState extends State<ActiveGameView> {
|
||||
const SizedBox(width: 5),
|
||||
Text(
|
||||
'${widget.gameSession.playerScores[playerIndex]} '
|
||||
'Punkte')
|
||||
'${AppLocalizations.of(context).points}')
|
||||
],
|
||||
),
|
||||
);
|
||||
@@ -67,7 +68,7 @@ class _ActiveGameViewState extends State<ActiveGameView> {
|
||||
Padding(
|
||||
padding: const EdgeInsets.fromLTRB(10, 10, 0, 0),
|
||||
child: Text(
|
||||
'Runden',
|
||||
AppLocalizations.of(context).rounds,
|
||||
style: CustomTheme.rowTitle,
|
||||
),
|
||||
),
|
||||
@@ -80,7 +81,7 @@ class _ActiveGameViewState extends State<ActiveGameView> {
|
||||
padding: const EdgeInsets.all(1),
|
||||
child: CupertinoListTile(
|
||||
title: Text(
|
||||
'Runde ${index + 1}',
|
||||
'${AppLocalizations.of(context).round} ${index + 1}',
|
||||
),
|
||||
trailing: index + 1 !=
|
||||
widget.gameSession.roundNumber ||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import 'package:cabo_counter/data/game_manager.dart';
|
||||
import 'package:cabo_counter/data/game_session.dart';
|
||||
import 'package:cabo_counter/l10n/app_localizations.dart';
|
||||
import 'package:cabo_counter/utility/custom_theme.dart';
|
||||
import 'package:cabo_counter/utility/globals.dart';
|
||||
import 'package:cabo_counter/views/active_game_view.dart';
|
||||
@@ -30,9 +31,9 @@ class _CreateGameState extends State<CreateGame> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return CupertinoPageScaffold(
|
||||
navigationBar: const CupertinoNavigationBar(
|
||||
previousPageTitle: 'Übersicht',
|
||||
middle: Text('Neues Spiel'),
|
||||
navigationBar: CupertinoNavigationBar(
|
||||
previousPageTitle: AppLocalizations.of(context).overview,
|
||||
middle: Text(AppLocalizations.of(context).new_game),
|
||||
),
|
||||
child: SafeArea(
|
||||
child: Center(
|
||||
@@ -43,7 +44,7 @@ class _CreateGameState extends State<CreateGame> {
|
||||
Padding(
|
||||
padding: const EdgeInsets.fromLTRB(10, 10, 0, 0),
|
||||
child: Text(
|
||||
'Spiel',
|
||||
AppLocalizations.of(context).game,
|
||||
style: CustomTheme.rowTitle,
|
||||
),
|
||||
),
|
||||
@@ -52,9 +53,9 @@ class _CreateGameState extends State<CreateGame> {
|
||||
child: CupertinoTextField(
|
||||
decoration: const BoxDecoration(),
|
||||
maxLength: 16,
|
||||
prefix: const Text('Name'),
|
||||
prefix: Text(AppLocalizations.of(context).name),
|
||||
textAlign: TextAlign.right,
|
||||
placeholder: 'Titel des Spiels',
|
||||
placeholder: AppLocalizations.of(context).game_title,
|
||||
controller: _gameTitleTextController,
|
||||
),
|
||||
),
|
||||
@@ -64,15 +65,15 @@ class _CreateGameState extends State<CreateGame> {
|
||||
child: CupertinoTextField(
|
||||
decoration: const BoxDecoration(),
|
||||
readOnly: true,
|
||||
prefix: const Text('Modus'),
|
||||
prefix: Text(AppLocalizations.of(context).mode),
|
||||
suffix: Row(
|
||||
children: [
|
||||
Text(
|
||||
selectedMode == null
|
||||
? 'Wähle einen Modus'
|
||||
? AppLocalizations.of(context).select_mode
|
||||
: (selectedMode!
|
||||
? '${Globals.pointLimit} Punkte'
|
||||
: 'Unbegrenzt'),
|
||||
? '${Globals.pointLimit} ${AppLocalizations.of(context).points}'
|
||||
: AppLocalizations.of(context).unlimited),
|
||||
),
|
||||
const SizedBox(width: 3),
|
||||
const CupertinoListTileChevron(),
|
||||
@@ -99,7 +100,7 @@ class _CreateGameState extends State<CreateGame> {
|
||||
Padding(
|
||||
padding: const EdgeInsets.fromLTRB(10, 10, 0, 0),
|
||||
child: Text(
|
||||
'Spieler:innen',
|
||||
AppLocalizations.of(context).players,
|
||||
style: CustomTheme.rowTitle,
|
||||
),
|
||||
),
|
||||
@@ -114,18 +115,18 @@ class _CreateGameState extends State<CreateGame> {
|
||||
padding: const EdgeInsets.symmetric(vertical: 8.0),
|
||||
child: CupertinoButton(
|
||||
padding: EdgeInsets.zero,
|
||||
child: const Row(
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Icon(
|
||||
const Icon(
|
||||
CupertinoIcons.add_circled,
|
||||
color: CupertinoColors.activeGreen,
|
||||
size: 25,
|
||||
),
|
||||
SizedBox(width: 8),
|
||||
const SizedBox(width: 8),
|
||||
Text(
|
||||
'Spieler hinzufügen',
|
||||
style: TextStyle(
|
||||
AppLocalizations.of(context).add_player,
|
||||
style: const TextStyle(
|
||||
color: CupertinoColors.activeGreen,
|
||||
),
|
||||
),
|
||||
@@ -141,14 +142,14 @@ class _CreateGameState extends State<CreateGame> {
|
||||
showCupertinoDialog(
|
||||
context: context,
|
||||
builder: (context) => CupertinoAlertDialog(
|
||||
title:
|
||||
const Text('Maximale Spielerzahl erreicht'),
|
||||
content: const Text(
|
||||
'Es können maximal 5 Spieler hinzugefügt '
|
||||
'werden.'),
|
||||
title: Text(AppLocalizations.of(context)
|
||||
.max_players_title),
|
||||
content: Text(AppLocalizations.of(context)
|
||||
.max_players_message),
|
||||
actions: [
|
||||
CupertinoDialogAction(
|
||||
child: const Text('OK'),
|
||||
child:
|
||||
Text(AppLocalizations.of(context).ok),
|
||||
onPressed: () => Navigator.pop(context),
|
||||
),
|
||||
],
|
||||
@@ -182,7 +183,8 @@ class _CreateGameState extends State<CreateGame> {
|
||||
Expanded(
|
||||
child: CupertinoTextField(
|
||||
controller: _playerNameTextControllers[index],
|
||||
placeholder: 'Spieler:in ${index + 1}',
|
||||
placeholder:
|
||||
'${AppLocalizations.of(context).player} ${index + 1}',
|
||||
padding: const EdgeInsets.all(12),
|
||||
decoration: const BoxDecoration(),
|
||||
),
|
||||
@@ -197,12 +199,12 @@ class _CreateGameState extends State<CreateGame> {
|
||||
Center(
|
||||
child: CupertinoButton(
|
||||
padding: EdgeInsets.zero,
|
||||
child: const Row(
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
'Spiel erstellen ',
|
||||
style: TextStyle(
|
||||
AppLocalizations.of(context).create_game,
|
||||
style: const TextStyle(
|
||||
color: CupertinoColors.activeGreen,
|
||||
),
|
||||
),
|
||||
@@ -213,13 +215,13 @@ class _CreateGameState extends State<CreateGame> {
|
||||
showCupertinoDialog(
|
||||
context: context,
|
||||
builder: (context) => CupertinoAlertDialog(
|
||||
title: const Text('Fehler'),
|
||||
content: const Text(
|
||||
'Es muss ein Titel für das Spiel eingegeben '
|
||||
'werden.'),
|
||||
title: Text(
|
||||
AppLocalizations.of(context).no_gameTitle_title),
|
||||
content: Text(
|
||||
AppLocalizations.of(context).no_gameTitle_message),
|
||||
actions: [
|
||||
CupertinoDialogAction(
|
||||
child: const Text('OK'),
|
||||
child: Text(AppLocalizations.of(context).ok),
|
||||
onPressed: () => Navigator.pop(context),
|
||||
),
|
||||
],
|
||||
@@ -231,12 +233,12 @@ class _CreateGameState extends State<CreateGame> {
|
||||
showCupertinoDialog(
|
||||
context: context,
|
||||
builder: (context) => CupertinoAlertDialog(
|
||||
title: const Text('Fehler'),
|
||||
content: const Text(
|
||||
'Es muss ein Spielmodus ausgewählt werden.'),
|
||||
title: Text(AppLocalizations.of(context).no_mode_title),
|
||||
content:
|
||||
Text(AppLocalizations.of(context).no_mode_message),
|
||||
actions: [
|
||||
CupertinoDialogAction(
|
||||
child: const Text('OK'),
|
||||
child: Text(AppLocalizations.of(context).ok),
|
||||
onPressed: () => Navigator.pop(context),
|
||||
),
|
||||
],
|
||||
@@ -248,13 +250,13 @@ class _CreateGameState extends State<CreateGame> {
|
||||
showCupertinoDialog(
|
||||
context: context,
|
||||
builder: (context) => CupertinoAlertDialog(
|
||||
title: const Text('Fehler'),
|
||||
content: const Text(
|
||||
'Es müssen mindestens 2 Spieler hinzugefügt '
|
||||
'werden.'),
|
||||
title: Text(
|
||||
AppLocalizations.of(context).min_players_title),
|
||||
content: Text(
|
||||
AppLocalizations.of(context).min_players_message),
|
||||
actions: [
|
||||
CupertinoDialogAction(
|
||||
child: const Text('OK'),
|
||||
child: Text(AppLocalizations.of(context).ok),
|
||||
onPressed: () => Navigator.pop(context),
|
||||
),
|
||||
],
|
||||
@@ -266,17 +268,18 @@ class _CreateGameState extends State<CreateGame> {
|
||||
showCupertinoDialog(
|
||||
context: context,
|
||||
builder: (context) => CupertinoAlertDialog(
|
||||
title: const Text('Fehler'),
|
||||
title: Text(AppLocalizations.of(context).no_name_title),
|
||||
content:
|
||||
const Text('Jeder Spieler muss einen Namen haben.'),
|
||||
Text(AppLocalizations.of(context).no_name_message),
|
||||
actions: [
|
||||
CupertinoDialogAction(
|
||||
child: const Text('OK'),
|
||||
child: Text(AppLocalizations.of(context).ok),
|
||||
onPressed: () => Navigator.pop(context),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
List<String> players = [];
|
||||
@@ -298,7 +301,7 @@ class _CreateGameState extends State<CreateGame> {
|
||||
CupertinoPageRoute(
|
||||
builder: (context) => ActiveGameView(
|
||||
gameSession: gameManager.gameList[index])));
|
||||
} else {}
|
||||
}
|
||||
},
|
||||
),
|
||||
),
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import 'package:cabo_counter/l10n/app_localizations.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||
@@ -10,18 +11,18 @@ class InformationView extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
return CupertinoPageScaffold(
|
||||
resizeToAvoidBottomInset: false,
|
||||
navigationBar: const CupertinoNavigationBar(
|
||||
middle: Text('Über'),
|
||||
navigationBar: CupertinoNavigationBar(
|
||||
middle: Text(AppLocalizations.of(context).about),
|
||||
),
|
||||
child: SafeArea(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
const Padding(
|
||||
padding: EdgeInsets.fromLTRB(0, 10, 0, 0),
|
||||
Padding(
|
||||
padding: const EdgeInsets.fromLTRB(0, 10, 0, 0),
|
||||
child: Text(
|
||||
'Cabo Counter',
|
||||
style: TextStyle(
|
||||
AppLocalizations.of(context).app_name,
|
||||
style: const TextStyle(
|
||||
fontSize: 30,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
@@ -34,18 +35,10 @@ class InformationView extends StatelessWidget {
|
||||
height: 200,
|
||||
child: Image.asset('assets/cabo_counter-logo_rounded.png'),
|
||||
)),
|
||||
const Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 30),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 30),
|
||||
child: Text(
|
||||
'Hey :) Danke, dass du als eine:r der ersten User '
|
||||
'meiner ersten eigenen App dabei bist! Ich hab sehr '
|
||||
'viel Arbeit in dieses Projekt gesteckt und auch, '
|
||||
'wenn ich (hoffentlich) an vieles Gedacht hab, wird '
|
||||
'auf jeden Fall noch nicht alles 100% funktionieren. '
|
||||
'Solltest du also irgendwelche Fehler entdecken oder '
|
||||
'Feedback zum Design oder der Benutzerfreundlichkeit'
|
||||
' haben, zögere bitte nicht sie mir auf den dir '
|
||||
'bekannten Wegen mitzuteilen. Danke! ',
|
||||
AppLocalizations.of(context).about_text,
|
||||
textAlign: TextAlign.center,
|
||||
softWrap: true,
|
||||
)),
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import 'package:cabo_counter/data/game_manager.dart';
|
||||
import 'package:cabo_counter/l10n/app_localizations.dart';
|
||||
import 'package:cabo_counter/services/local_storage_service.dart';
|
||||
import 'package:cabo_counter/utility/custom_theme.dart';
|
||||
import 'package:cabo_counter/utility/globals.dart';
|
||||
@@ -141,7 +142,7 @@ class _MainMenuViewState extends State<MainMenuView> {
|
||||
fontSize: 14),
|
||||
)
|
||||
: Text(
|
||||
'Modus: ${_translateGameMode(session.isPointsLimitEnabled)}',
|
||||
'${AppLocalizations.of(context).mode}: ${_translateGameMode(session.isPointsLimitEnabled)}',
|
||||
style: const TextStyle(
|
||||
fontSize: 14),
|
||||
),
|
||||
@@ -186,8 +187,10 @@ class _MainMenuViewState extends State<MainMenuView> {
|
||||
/// Translates the game mode boolean into the corresponding String.
|
||||
/// If [pointLimit] is true, it returns '101 Punkte', otherwise it returns 'Unbegrenzt'.
|
||||
String _translateGameMode(bool pointLimit) {
|
||||
if (pointLimit) return '${Globals.pointLimit} Punkte';
|
||||
return 'Unbegrenzt';
|
||||
if (pointLimit) {
|
||||
return '${Globals.pointLimit} ${AppLocalizations.of(context).points}';
|
||||
}
|
||||
return AppLocalizations.of(context).unlimited;
|
||||
}
|
||||
|
||||
/// Shows a confirmation dialog to delete all game sessions.
|
||||
@@ -198,21 +201,21 @@ class _MainMenuViewState extends State<MainMenuView> {
|
||||
context: context,
|
||||
builder: (context) {
|
||||
return CupertinoAlertDialog(
|
||||
title: const Text('Spiel löschen?'),
|
||||
title: Text(AppLocalizations.of(context).delete_game_title),
|
||||
content: Text(
|
||||
'Bist du sicher, dass du die Runde "$gameTitle" löschen möchtest? Diese Aktion kann nicht rückgängig gemacht werden.'),
|
||||
AppLocalizations.of(context).delete_game_message(gameTitle)),
|
||||
actions: [
|
||||
CupertinoDialogAction(
|
||||
onPressed: () {
|
||||
Navigator.pop(context, false);
|
||||
},
|
||||
child: const Text('Abbrechen'),
|
||||
child: Text(AppLocalizations.of(context).cancel),
|
||||
),
|
||||
CupertinoDialogAction(
|
||||
onPressed: () {
|
||||
Navigator.pop(context, true);
|
||||
},
|
||||
child: const Text('Löschen'),
|
||||
child: Text(AppLocalizations.of(context).delete),
|
||||
),
|
||||
],
|
||||
);
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import 'package:cabo_counter/l10n/app_localizations.dart';
|
||||
import 'package:cabo_counter/utility/custom_theme.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
|
||||
@@ -8,17 +9,19 @@ class ModeSelectionMenu extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return CupertinoPageScaffold(
|
||||
navigationBar: const CupertinoNavigationBar(
|
||||
middle: Text('Spielmodus auswählen'),
|
||||
navigationBar: CupertinoNavigationBar(
|
||||
middle: Text(AppLocalizations.of(context).select_game_mode),
|
||||
),
|
||||
child: ListView(
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.fromLTRB(0, 16, 0, 0),
|
||||
child: CupertinoListTile(
|
||||
title: Text('$pointLimit Punkte', style: CustomTheme.modeTitle),
|
||||
title: Text('$pointLimit ${AppLocalizations.of(context).points}',
|
||||
style: CustomTheme.modeTitle),
|
||||
subtitle: Text(
|
||||
'Es wird solange gespielt, bis einer Spieler mehr als $pointLimit Punkte erreicht',
|
||||
AppLocalizations.of(context)
|
||||
.point_limit_description(pointLimit),
|
||||
style: CustomTheme.modeDescription,
|
||||
maxLines: 3,
|
||||
),
|
||||
@@ -30,10 +33,10 @@ class ModeSelectionMenu extends StatelessWidget {
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 16.0),
|
||||
child: CupertinoListTile(
|
||||
title: Text('Unbegrenzt', style: CustomTheme.modeTitle),
|
||||
subtitle: const Text(
|
||||
'Dem Spiel sind keine Grenzen gesetzt. Es wird so lange '
|
||||
'gespielt, bis Ihr keine Lust mehr habt.',
|
||||
title: Text(AppLocalizations.of(context).unlimited,
|
||||
style: CustomTheme.modeTitle),
|
||||
subtitle: Text(
|
||||
AppLocalizations.of(context).unlimited_description,
|
||||
style: CustomTheme.modeDescription,
|
||||
maxLines: 3,
|
||||
),
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import 'package:cabo_counter/data/game_session.dart';
|
||||
import 'package:cabo_counter/l10n/app_localizations.dart';
|
||||
import 'package:cabo_counter/services/local_storage_service.dart';
|
||||
import 'package:cabo_counter/utility/custom_theme.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
@@ -71,15 +72,14 @@ class _RoundViewState extends State<RoundView> {
|
||||
resizeToAvoidBottomInset: false,
|
||||
navigationBar: CupertinoNavigationBar(
|
||||
transitionBetweenRoutes: true,
|
||||
middle: const Text('Ergebnisse'),
|
||||
previousPageTitle: 'Übersicht',
|
||||
middle: Text(AppLocalizations.of(context).results),
|
||||
leading: CupertinoButton(
|
||||
padding: EdgeInsets.zero,
|
||||
onPressed: () => {
|
||||
LocalStorageService.saveGameSessions(),
|
||||
Navigator.pop(context, widget.gameSession)
|
||||
},
|
||||
child: const Text('Abbrechen'),
|
||||
child: Text(AppLocalizations.of(context).cancel),
|
||||
),
|
||||
),
|
||||
child: Stack(
|
||||
@@ -92,12 +92,13 @@ class _RoundViewState extends State<RoundView> {
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
const SizedBox(height: 40),
|
||||
Text('Runde ${widget.roundNumber}',
|
||||
Text(
|
||||
'${AppLocalizations.of(context).round} ${widget.roundNumber}',
|
||||
style: CustomTheme.roundTitle),
|
||||
const SizedBox(height: 10),
|
||||
const Text(
|
||||
'Wer hat CABO gesagt?',
|
||||
style: TextStyle(fontWeight: FontWeight.bold),
|
||||
Text(
|
||||
AppLocalizations.of(context).who_said_cabo,
|
||||
style: const TextStyle(fontWeight: FontWeight.bold),
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(
|
||||
@@ -156,19 +157,23 @@ class _RoundViewState extends State<RoundView> {
|
||||
),
|
||||
),
|
||||
),
|
||||
const Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 20.0),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 20.0),
|
||||
child: CupertinoListTile(
|
||||
title: Text('Spieler:in'),
|
||||
title: Text(AppLocalizations.of(context).player),
|
||||
trailing: Row(
|
||||
children: [
|
||||
SizedBox(
|
||||
width: 100,
|
||||
child: Center(child: Text('Punkte'))),
|
||||
SizedBox(width: 20),
|
||||
child: Center(
|
||||
child: Text(
|
||||
AppLocalizations.of(context).points))),
|
||||
const SizedBox(width: 20),
|
||||
SizedBox(
|
||||
width: 80,
|
||||
child: Center(child: Text('Kamikaze'))),
|
||||
child: Center(
|
||||
child: Text(AppLocalizations.of(context)
|
||||
.kamikaze))),
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -189,7 +194,7 @@ class _RoundViewState extends State<RoundView> {
|
||||
title: Row(children: [Text(name)]),
|
||||
subtitle: Text(
|
||||
'${widget.gameSession.playerScores[index]}'
|
||||
' Punkte'),
|
||||
' ${AppLocalizations.of(context).points}'),
|
||||
trailing: Row(
|
||||
children: [
|
||||
SizedBox(
|
||||
@@ -212,7 +217,8 @@ class _RoundViewState extends State<RoundView> {
|
||||
? TextInputAction.done
|
||||
: TextInputAction.next,
|
||||
controller: _scoreControllerList[index],
|
||||
placeholder: 'Punkte',
|
||||
placeholder:
|
||||
AppLocalizations.of(context).points,
|
||||
textAlign: TextAlign.center,
|
||||
onSubmitted: (_) =>
|
||||
_focusNextTextfield(index),
|
||||
@@ -287,7 +293,7 @@ class _RoundViewState extends State<RoundView> {
|
||||
Navigator.pop(context, widget.gameSession);
|
||||
}
|
||||
: null,
|
||||
child: const Text('Fertig'),
|
||||
child: Text(AppLocalizations.of(context).done),
|
||||
),
|
||||
CupertinoButton(
|
||||
onPressed: _areRoundInputsValid()
|
||||
@@ -309,7 +315,7 @@ class _RoundViewState extends State<RoundView> {
|
||||
}
|
||||
}
|
||||
: null,
|
||||
child: const Text('Nächste Runde'),
|
||||
child: Text(AppLocalizations.of(context).next_round),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import 'package:cabo_counter/l10n/app_localizations.dart';
|
||||
import 'package:cabo_counter/services/config_service.dart';
|
||||
import 'package:cabo_counter/services/local_storage_service.dart';
|
||||
import 'package:cabo_counter/utility/custom_theme.dart';
|
||||
@@ -25,8 +26,8 @@ class _SettingsViewState extends State<SettingsView> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return CupertinoPageScaffold(
|
||||
navigationBar: const CupertinoNavigationBar(
|
||||
middle: Text('Einstellungen'),
|
||||
navigationBar: CupertinoNavigationBar(
|
||||
middle: Text(AppLocalizations.of(context).settings),
|
||||
),
|
||||
child: SafeArea(
|
||||
child: Stack(
|
||||
@@ -38,7 +39,7 @@ class _SettingsViewState extends State<SettingsView> {
|
||||
Padding(
|
||||
padding: const EdgeInsets.fromLTRB(10, 10, 0, 0),
|
||||
child: Text(
|
||||
'Punkte',
|
||||
AppLocalizations.of(context).points,
|
||||
style: CustomTheme.rowTitle,
|
||||
),
|
||||
),
|
||||
@@ -46,8 +47,9 @@ class _SettingsViewState extends State<SettingsView> {
|
||||
padding: const EdgeInsets.fromLTRB(15, 10, 10, 0),
|
||||
child: CupertinoListTile(
|
||||
padding: EdgeInsets.zero,
|
||||
title: const Text('Cabo-Strafe'),
|
||||
subtitle: const Text('... für falsches Cabo sagen'),
|
||||
title: Text(AppLocalizations.of(context).cabo_penalty),
|
||||
subtitle: Text(
|
||||
AppLocalizations.of(context).cabo_penalty_subtitle),
|
||||
trailing: Stepper(
|
||||
key: _stepperKey1,
|
||||
initialValue: Globals.caboPenalty,
|
||||
@@ -66,8 +68,9 @@ class _SettingsViewState extends State<SettingsView> {
|
||||
padding: const EdgeInsets.fromLTRB(15, 10, 10, 0),
|
||||
child: CupertinoListTile(
|
||||
padding: EdgeInsets.zero,
|
||||
title: const Text('Punkte-Limit'),
|
||||
subtitle: const Text('... hier ist Schluss'),
|
||||
title: Text(AppLocalizations.of(context).point_limit),
|
||||
subtitle:
|
||||
Text(AppLocalizations.of(context).point_limit_subtitle),
|
||||
trailing: Stepper(
|
||||
key: _stepperKey2,
|
||||
initialValue: Globals.pointLimit,
|
||||
@@ -93,13 +96,14 @@ class _SettingsViewState extends State<SettingsView> {
|
||||
_stepperKey1 = UniqueKey();
|
||||
_stepperKey2 = UniqueKey();
|
||||
}),
|
||||
child: const Text('Auf Standard zurücksetzten'),
|
||||
child:
|
||||
Text(AppLocalizations.of(context).reset_to_default),
|
||||
),
|
||||
)),
|
||||
Padding(
|
||||
padding: const EdgeInsets.fromLTRB(10, 10, 0, 0),
|
||||
child: Text(
|
||||
'Spieldaten',
|
||||
AppLocalizations.of(context).game_data,
|
||||
style: CustomTheme.rowTitle,
|
||||
),
|
||||
),
|
||||
@@ -114,7 +118,7 @@ class _SettingsViewState extends State<SettingsView> {
|
||||
color: CustomTheme.primaryColor,
|
||||
sizeStyle: CupertinoButtonSize.medium,
|
||||
child: Text(
|
||||
'Daten importieren',
|
||||
AppLocalizations.of(context).import_data,
|
||||
style:
|
||||
TextStyle(color: CustomTheme.backgroundColor),
|
||||
),
|
||||
@@ -125,12 +129,17 @@ class _SettingsViewState extends State<SettingsView> {
|
||||
showCupertinoDialog(
|
||||
context: context,
|
||||
builder: (context) => CupertinoAlertDialog(
|
||||
title: const Text('Fehler'),
|
||||
content: const Text(
|
||||
'Datei konnte nicht importiert werden.'),
|
||||
title: Text(
|
||||
AppLocalizations.of(context)
|
||||
.error),
|
||||
content: Text(
|
||||
AppLocalizations.of(context)
|
||||
.error_import),
|
||||
actions: [
|
||||
CupertinoDialogAction(
|
||||
child: const Text('OK'),
|
||||
child: Text(
|
||||
AppLocalizations.of(context)
|
||||
.ok),
|
||||
onPressed: () =>
|
||||
Navigator.pop(context),
|
||||
),
|
||||
@@ -145,7 +154,7 @@ class _SettingsViewState extends State<SettingsView> {
|
||||
color: CustomTheme.primaryColor,
|
||||
sizeStyle: CupertinoButtonSize.medium,
|
||||
child: Text(
|
||||
'Daten exportieren',
|
||||
AppLocalizations.of(context).export_data,
|
||||
style:
|
||||
TextStyle(color: CustomTheme.backgroundColor),
|
||||
),
|
||||
@@ -156,12 +165,14 @@ class _SettingsViewState extends State<SettingsView> {
|
||||
showCupertinoDialog(
|
||||
context: context,
|
||||
builder: (context) => CupertinoAlertDialog(
|
||||
title: const Text('Fehler'),
|
||||
content: const Text(
|
||||
'Datei konnte nicht exportiert werden.'),
|
||||
title:
|
||||
Text(AppLocalizations.of(context).error),
|
||||
content: Text(AppLocalizations.of(context)
|
||||
.error_export),
|
||||
actions: [
|
||||
CupertinoDialogAction(
|
||||
child: const Text('OK'),
|
||||
child:
|
||||
Text(AppLocalizations.of(context).ok),
|
||||
onPressed: () => Navigator.pop(context),
|
||||
),
|
||||
],
|
||||
@@ -181,8 +192,8 @@ class _SettingsViewState extends State<SettingsView> {
|
||||
right: 0,
|
||||
child: Column(
|
||||
children: [
|
||||
const Center(
|
||||
child: Text('Fehler gefunden?'),
|
||||
Center(
|
||||
child: Text(AppLocalizations.of(context).error_found),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.fromLTRB(0, 0, 0, 30),
|
||||
@@ -190,7 +201,7 @@ class _SettingsViewState extends State<SettingsView> {
|
||||
child: CupertinoButton(
|
||||
onPressed: () => launchUrl(Uri.parse(
|
||||
'https://github.com/flixcoo/Cabo-Counter/issues')),
|
||||
child: const Text('Issue erstellen'),
|
||||
child: Text(AppLocalizations.of(context).create_issue),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -200,17 +211,17 @@ class _SettingsViewState extends State<SettingsView> {
|
||||
if (snapshot.hasData) {
|
||||
return Text(
|
||||
'${Globals.appDevPhase} ${snapshot.data!.version} '
|
||||
'(Build ${snapshot.data!.buildNumber})',
|
||||
'(${AppLocalizations.of(context).build} ${snapshot.data!.buildNumber})',
|
||||
textAlign: TextAlign.center,
|
||||
);
|
||||
} else if (snapshot.hasError) {
|
||||
return const Text(
|
||||
'App-Version -.-.- (Build -)',
|
||||
return Text(
|
||||
'${AppLocalizations.of(context).app_version} -.-.- (${AppLocalizations.of(context).build} -)',
|
||||
textAlign: TextAlign.center,
|
||||
);
|
||||
}
|
||||
return const Text(
|
||||
'Lade Version...',
|
||||
return Text(
|
||||
AppLocalizations.of(context).load_version,
|
||||
textAlign: TextAlign.center,
|
||||
);
|
||||
},
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import 'package:cabo_counter/l10n/app_localizations.dart';
|
||||
import 'package:cabo_counter/utility/custom_theme.dart';
|
||||
import 'package:cabo_counter/views/information_view.dart';
|
||||
import 'package:cabo_counter/views/main_menu_view.dart';
|
||||
@@ -19,18 +20,18 @@ class _TabViewState extends State<TabView> {
|
||||
backgroundColor: CustomTheme.backgroundTintColor,
|
||||
iconSize: 27,
|
||||
height: 55,
|
||||
items: const <BottomNavigationBarItem>[
|
||||
items: <BottomNavigationBarItem>[
|
||||
BottomNavigationBarItem(
|
||||
icon: Icon(
|
||||
icon: const Icon(
|
||||
CupertinoIcons.house_fill,
|
||||
),
|
||||
label: 'Home',
|
||||
label: AppLocalizations.of(context).home,
|
||||
),
|
||||
BottomNavigationBarItem(
|
||||
icon: Icon(
|
||||
icon: const Icon(
|
||||
CupertinoIcons.info,
|
||||
),
|
||||
label: 'About',
|
||||
label: AppLocalizations.of(context).about,
|
||||
),
|
||||
]),
|
||||
tabBuilder: (BuildContext context, int index) {
|
||||
|
||||
Reference in New Issue
Block a user