Skip to content

Commit

Permalink
uiStrings for all the rest (hopefully)
Browse files Browse the repository at this point in the history
  • Loading branch information
FelberMartin committed Sep 12, 2024
1 parent 7f296af commit 5fb8105
Show file tree
Hide file tree
Showing 13 changed files with 200 additions and 57 deletions.
144 changes: 144 additions & 0 deletions lib/config/flavors/ui_string.dart
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,44 @@ abstract class UiString {
// Game
abstract String ttlHiddenLevel;
abstract String lblChainGameLevel;
abstract String lblHiddenWords;
abstract String lblSnackbarMuted;
abstract String lblSnackbarUnmuted;

// Game - Dialogs
abstract String ttlChainNewGameMode;
abstract String lblChainNewGameModeDescription;
abstract String lblChainNewGameModeTryIt;
abstract String btnGotIt;

abstract String ttlHiddenComponents;
abstract String lblHiddenComponentsDescription;

abstract String ttlHints;
abstract String lblHintsDescription;
abstract String lblHintsTryIt;

abstract String ttlMissingCompounds;
abstract String lblMissingCompoundsDescription;
abstract String lblMissingCompoundsDescription2;

abstract List<String> ttlLevelCompletedVariants;
abstract String lblLevelCompleted;
abstract String lblDifficulty;
abstract String lblMistakes;
abstract String btnContinue;
abstract String btnBackToOverview;

abstract String ttlNoAttemptsLeft;
abstract String btnContinueWithHint;
abstract String btnRestartGame;

abstract String ttlReport;
abstract String lblReportDescription;
abstract String btnCancel;
abstract String btnSend;
abstract String lblEnterWordHint;


// Ads
abstract String lblDoYouEnjoy;
Expand Down Expand Up @@ -92,6 +130,60 @@ class UiStringDe extends UiString {
// Game
String ttlHiddenLevel = "Verstecktes Level";
String lblChainGameLevel = "Wortkette";
String lblHiddenWords = "Versteckte Wörter";
String lblSnackbarMuted = "Lautlos";
String lblSnackbarUnmuted = "Ton an";

// Game - Dialogs
String ttlChainNewGameMode = "💡 Neuer Spielmodus: Wortkette!";
String lblChainNewGameModeDescription = "Bei diesem Spielmodus ist das erste Wort gegeben und du musst nur das dazugehörige zweite Wort finden. "
"Danach geht es immer so weiter und es bildet sich ein lange Wortkette.";
String lblChainNewGameModeTryIt = "Probier es einfach aus!";
String btnGotIt = "Alles klar";

String ttlHiddenComponents = "💡 Verdeckte Wörter";
String lblHiddenComponentsDescription = "Verdeckte Wörter werden erst sichtbar, wenn du andere Wörter richtig kombinierst!";

String ttlHints = "💡 Tipps";
String lblHintsDescription = "Wenn du Hilfe brauchst und nicht mehr weiter weißt, benutze einen Tipp!";
String lblHintsTryIt = "Probier es einfach aus, der erste Tipp geht aufs Haus!";

String ttlMissingCompounds = "💡 Fehlende Wörter";
String lblMissingCompoundsDescription = "Hast du ein richtiges Wort kombiniert, aber es wird nicht aktzeptiert? "
"Du kannst diese Wörter melden und wir kümmern uns darum!";
String lblMissingCompoundsDescription2 = "Du kannst diese Wörter melden und wir kümmern uns darum!";

List<String> ttlLevelCompletedVariants = [
"Glückwunsch!",
"Super!",
"Fantastisch!",
"Perfekt!",
"Gut gemacht!",
"Bravo!",
"Genial!",
"Sensationell!",
"Klasse!",
"Wow!",
"Ausgezeichnet!",
"Großartig!",
"Einfach stark!"
];
String lblLevelCompleted = "Level geschaft!";
String lblDifficulty = "Schwierigkeit";
String lblMistakes = "Fehler";
String btnContinue = "Weiter";
String btnBackToOverview = "Zurück zur Übersicht";

String ttlNoAttemptsLeft = "Du hast alle Versuche aufgebraucht!";
String btnContinueWithHint = "Mit Tipp fortfahren";
String btnRestartGame = "Neustarten";

String ttlReport = "Du hast ein fehlendes Wort gefunden?";
String lblReportDescription = "Danke, dass du uns hilfst das Spiel noch besser zu machen!";
String btnCancel = "Abbrechen";
String btnSend = "Senden";
String lblEnterWordHint = "Wort eingeben";


// Ads
String lblDoYouEnjoy = "Gefällt dir";
Expand Down Expand Up @@ -153,6 +245,58 @@ class UiStringEn extends UiString {
// Game
String ttlHiddenLevel = "Hidden Level";
String lblChainGameLevel = "Chain";
String lblHiddenWords = "Hidden Words";
String lblSnackbarMuted = "Muted";
String lblSnackbarUnmuted = "Unmuted";

// Game - Dialogs
String ttlChainNewGameMode = "💡 New Game Mode: Chain!";
String lblChainNewGameModeDescription = "In this game mode, the first word is given and you only have to find the corresponding second word. "
"After that, it continues like this and a long chain of words is formed.";
String lblChainNewGameModeTryIt = "Just try it out!";
String btnGotIt = "Got it";

String ttlHiddenComponents = "💡 Hidden Words";
String lblHiddenComponentsDescription = "Hidden words only become visible when you combine other words correctly!";

String ttlHints = "💡 Hints";
String lblHintsDescription = "If you need help and don't know what to do next, use a hint!";
String lblHintsTryIt = "Just try it out, the first hint is on the house!";

String ttlMissingCompounds = "💡 Missing Words";
String lblMissingCompoundsDescription = "Have you combined a correct word, but it is not accepted? "
"You can report these words and we will take care of it!";
String lblMissingCompoundsDescription2 = "You can report these words and we will take care of it!";

List<String> ttlLevelCompletedVariants = [
"Congratulations!",
"Great!",
"Fantastic!",
"Perfect!",
"Well done!",
"Bravo!",
"Genius!",
"Wow!",
"Excellent!",
"Great!",
"Simply great!"
];
String lblLevelCompleted = "Level completed!";
String lblDifficulty = "Difficulty";
String lblMistakes = "Mistakes";
String btnContinue = "Continue";
String btnBackToOverview = "Back to Overview";

String ttlNoAttemptsLeft = "You have used all attempts!";
String btnContinueWithHint = "Continue with Hint";
String btnRestartGame = "Restart";

String ttlReport = "Did you find a missing word?";
String lblReportDescription = "Thank you for helping us make the game even better!";
String btnCancel = "Cancel";
String btnSend = "Send";
String lblEnterWordHint = "Enter word";


// Ads
String lblDoYouEnjoy = "Do you enjoy";
Expand Down
11 changes: 7 additions & 4 deletions lib/widgets/play/bottom_content.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import 'package:animated_flip_counter/animated_flip_counter.dart';
import 'package:flutter/material.dart';
import 'package:kompositum/config/flavors/flavor.dart';
import 'package:kompositum/config/star_costs_rewards.dart';
import 'package:kompositum/widgets/common/my_3d_container.dart';

Expand Down Expand Up @@ -189,10 +190,12 @@ class HiddenComponentsIndicator extends StatelessWidget {
textStyle: Theme.of(context).textTheme.titleSmall,
padding: const EdgeInsets.only(top: 0.0),
),
Text("verdeckte Wörter",
style: Theme.of(context).textTheme.labelSmall!.copyWith(
color: MyColorPalette.of(context).textSecondary,
))
Text(
Flavor.instance.uiString.lblHiddenWords,
style: Theme.of(context).textTheme.labelSmall!.copyWith(
color: MyColorPalette.of(context).textSecondary,
)
),
],
)),
);
Expand Down
6 changes: 4 additions & 2 deletions lib/widgets/play/combination_area.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'dart:async';

import 'package:flutter/material.dart';
import 'package:kompositum/config/flavors/flavor.dart';
import 'package:kompositum/config/my_icons.dart';
import 'package:kompositum/game/game_event/game_event.dart';
import 'package:kompositum/widgets/common/my_icon_button.dart';
Expand Down Expand Up @@ -94,8 +95,9 @@ class _CombinationAreaState extends State<CombinationArea> {
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
content: Text(AudioManager.instance.isMuted
? "Lautlos"
: "Ton an"),
? Flavor.instance.uiString.lblSnackbarMuted
: Flavor.instance.uiString.lblSnackbarUnmuted
),
behavior: SnackBarBehavior.floating,
duration: const Duration(milliseconds: 1500),
),
Expand Down
30 changes: 8 additions & 22 deletions lib/widgets/play/dialogs/level_completed_dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -69,21 +69,7 @@ class LevelCompletedDialogResult {

class LevelCompletedDialog extends StatefulWidget {

static const List<String> titles = [
"Glückwunsch!",
"Super!",
"Fantastisch!",
"Perfekt!",
"Gut gemacht!",
"Bravo!",
"Genial!",
"Sensationell!",
"Klasse!",
"Wow!",
"Ausgezeichnet!",
"Großartig!",
"Einfach stark!"
];
static List<String> titles = Flavor.instance.uiString.ttlLevelCompletedVariants;

LevelCompletedDialog({
super.key,
Expand Down Expand Up @@ -178,7 +164,7 @@ class _LevelCompletedDialogState extends State<LevelCompletedDialog> {
),
SizedBox(height: 12),
Text(
"Level geschaft!",
Flavor.instance.uiString.lblLevelCompleted,
style: Theme.of(context).textTheme.labelSmall,
),
Expanded(child: Container()),
Expand Down Expand Up @@ -302,13 +288,13 @@ class _LevelRewardCalculationState extends State<LevelRewardCalculation> {
),
SizedBox(height: 16.0),
LevelInfo(
infoName: "Schwierigkeit",
infoName: Flavor.instance.uiString.lblDifficulty,
infoValue: Flavor.instance.uiString.getDifficultyText(widget.difficulty),
hidden: _hideDifficulty,
),
SizedBox(height: 4.0),
LevelInfo(
infoName: "Fehler",
infoName: Flavor.instance.uiString.lblMistakes,
infoValue: widget.failedAttempts.toString(),
hidden: _hideFailedAttempts,
),
Expand Down Expand Up @@ -369,7 +355,7 @@ class _BottomContent extends StatelessWidget {
Widget build(BuildContext context) {
if (type == LevelCompletedDialogType.classic) {
return MyPrimaryTextButtonLarge(
text: "Weiter",
text: Flavor.instance.uiString.btnContinue,
onPressed: () {
onContinue(LevelCompletedDialogResultType.classic_continue);
},
Expand All @@ -378,14 +364,14 @@ class _BottomContent extends StatelessWidget {
return Column(
children: [
MySecondaryTextButton(
text: "Zurück zur Übersicht",
text: Flavor.instance.uiString.btnBackToOverview,
onPressed: () {
onContinue(LevelCompletedDialogResultType.daily_backToOverview);
},
),
SizedBox(height: 8),
MyPrimaryTextButton(
text: "Level $nextLevelNumber",
text: Flavor.instance.uiString.lblLevelIndicator + " $nextLevelNumber",
onPressed: () {
onContinue(LevelCompletedDialogResultType.daily_continueWithClassic);
},
Expand All @@ -394,7 +380,7 @@ class _BottomContent extends StatelessWidget {
);
} else if (type == LevelCompletedDialogType.secretLevel) {
return MyPrimaryTextButtonLarge(
text: "Weiter",
text: Flavor.instance.uiString.btnContinue,
onPressed: () {
onContinue(LevelCompletedDialogResultType.secretLevel_continue);
},
Expand Down
9 changes: 5 additions & 4 deletions lib/widgets/play/dialogs/no_attempts_left_dialog.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:kompositum/config/flavors/flavor.dart';
import 'package:kompositum/widgets/common/my_buttons.dart';
import 'package:kompositum/widgets/common/util/corner_radius.dart';

Expand Down Expand Up @@ -31,24 +32,24 @@ class NoAttemptsLeftDialog extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MyDialog(
title: "Du hast alle Versuche aufgebraucht!",
title: Flavor.instance.uiString.ttlNoAttemptsLeft,
child: Column(
children: [
OptionCard(
icon: MyIcons.hint,
iconSubtitleText: "$hintCost",
iconSubtitleIcon: MyIcons.star,
actionText: "Mit Tipp fortfahren",
actionText: Flavor.instance.uiString.btnContinueWithHint,
onActionPressed: () { onActionPressed(NoAttemptsLeftDialogAction.hint); },
isEnabled: isHintAvailable,
roundTop: true,
),
SizedBox(height: 8),
OptionCard(
icon: FontAwesomeIcons.redo,
iconSubtitleText: "Werbung",
iconSubtitleText: Flavor.instance.uiString.lblAd,
iconSubtitleIcon: MyIcons.ad,
actionText: "Neustarten",
actionText: Flavor.instance.uiString.btnRestartGame,
onActionPressed: () { onActionPressed(NoAttemptsLeftDialogAction.restart); },
roundBottom: true,
),
Expand Down
11 changes: 6 additions & 5 deletions lib/widgets/play/dialogs/report_dialog.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'package:firebase_core/firebase_core.dart';
import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:kompositum/config/flavors/flavor.dart';
import 'package:kompositum/util/extensions/color_util.dart';
import 'package:kompositum/widgets/common/my_buttons.dart';
import 'package:kompositum/widgets/common/my_dialog.dart';
Expand Down Expand Up @@ -62,7 +63,7 @@ class _ReportDialogState extends State<ReportDialog> {
@override
Widget build(BuildContext context) {
return MyDialog(
title: "Du hast ein fehlendes Wort gefunden?",
title: Flavor.instance.uiString.ttlReport,
child: Column(
children: [
SizedBox(height: 16),
Expand All @@ -88,7 +89,7 @@ class _ReportDialogState extends State<ReportDialog> {
Padding(
padding: const EdgeInsets.symmetric(horizontal: 8.0),
child: Text(
"Danke, dass du uns hilfst das Spiel noch besser zu machen!",
Flavor.instance.uiString.lblReportDescription,
textAlign: TextAlign.center,
style: Theme.of(context).textTheme.labelSmall!.copyWith(
color: Theme.of(context).colorScheme.onSecondary,
Expand Down Expand Up @@ -129,7 +130,7 @@ class ActionButtonRow extends StatelessWidget {
return Row(
children: [
MySecondaryTextButton(
text: "Abbrechen",
text: Flavor.instance.uiString.btnCancel,
onPressed: onCancelPressed,
),
SizedBox(width: 8),
Expand Down Expand Up @@ -160,7 +161,7 @@ class ActionButtonRow extends StatelessWidget {
);
} else {
content = Text(
"Senden",
Flavor.instance.uiString.btnSend,
style: Theme.of(context).textTheme.labelMedium!.copyWith(
color: isSendEnabled
? Theme.of(context).colorScheme.onPrimary
Expand Down Expand Up @@ -228,7 +229,7 @@ class InputRow extends StatelessWidget {
Expanded(
child: TextField(
decoration: InputDecoration(
hintText: "Wort eingeben",
hintText: Flavor.instance.uiString.lblEnterWordHint,
hintStyle: Theme.of(context).textTheme.labelLarge!.copyWith(
color: MyColorPalette.of(context).primary,
fontStyle: FontStyle.italic,
Expand Down
Loading

0 comments on commit 5fb8105

Please sign in to comment.