Felix Zieger commited on
Commit
81e6964
·
1 Parent(s): ac04e03
src/components/GameContainer.tsx CHANGED
@@ -55,6 +55,13 @@ export const GameContainer = () => {
55
 
56
  const handleBack = () => {
57
  setGameState("welcome");
 
 
 
 
 
 
 
58
  };
59
 
60
  const handleThemeSelect = async (theme: string) => {
@@ -110,7 +117,6 @@ export const GameContainer = () => {
110
  const handleMakeGuess = async () => {
111
  setIsAiThinking(true);
112
  try {
113
- // Add the current input to the sentence if it exists
114
  let finalSentence = sentence;
115
  if (playerInput.trim()) {
116
  finalSentence = [...sentence, playerInput.trim()];
@@ -148,7 +154,7 @@ export const GameContainer = () => {
148
  setGameState("building-sentence");
149
  setSentence([]);
150
  setAiGuess("");
151
- setUsedWords(prev => [...prev, word]); // Add new word to used words
152
  console.log("Next round started with word:", word, "theme:", currentTheme);
153
  } catch (error) {
154
  console.error('Error getting new word:', error);
@@ -173,7 +179,7 @@ export const GameContainer = () => {
173
  setCurrentTheme("standard");
174
  setSuccessfulRounds(0);
175
  setTotalWords(0);
176
- setUsedWords([]); // Reset used words when starting over
177
  };
178
 
179
  const isGuessCorrect = () => {
@@ -214,6 +220,7 @@ export const GameContainer = () => {
214
  onInputChange={setPlayerInput}
215
  onSubmitWord={handlePlayerWord}
216
  onMakeGuess={handleMakeGuess}
 
217
  />
218
  ) : gameState === "showing-guess" ? (
219
  <GuessDisplay
@@ -234,4 +241,4 @@ export const GameContainer = () => {
234
  </motion.div>
235
  </div>
236
  );
237
- };
 
55
 
56
  const handleBack = () => {
57
  setGameState("welcome");
58
+ setSentence([]);
59
+ setAiGuess("");
60
+ setCurrentWord("");
61
+ setCurrentTheme("standard");
62
+ setSuccessfulRounds(0);
63
+ setTotalWords(0);
64
+ setUsedWords([]);
65
  };
66
 
67
  const handleThemeSelect = async (theme: string) => {
 
117
  const handleMakeGuess = async () => {
118
  setIsAiThinking(true);
119
  try {
 
120
  let finalSentence = sentence;
121
  if (playerInput.trim()) {
122
  finalSentence = [...sentence, playerInput.trim()];
 
154
  setGameState("building-sentence");
155
  setSentence([]);
156
  setAiGuess("");
157
+ setUsedWords(prev => [...prev, word]);
158
  console.log("Next round started with word:", word, "theme:", currentTheme);
159
  } catch (error) {
160
  console.error('Error getting new word:', error);
 
179
  setCurrentTheme("standard");
180
  setSuccessfulRounds(0);
181
  setTotalWords(0);
182
+ setUsedWords([]);
183
  };
184
 
185
  const isGuessCorrect = () => {
 
220
  onInputChange={setPlayerInput}
221
  onSubmitWord={handlePlayerWord}
222
  onMakeGuess={handleMakeGuess}
223
+ onBack={handleBack}
224
  />
225
  ) : gameState === "showing-guess" ? (
226
  <GuessDisplay
 
241
  </motion.div>
242
  </div>
243
  );
244
+ };
src/components/game/GuessDisplay.tsx CHANGED
@@ -36,25 +36,46 @@ export const GuessDisplay = ({
36
  <motion.div
37
  initial={{ opacity: 0 }}
38
  animate={{ opacity: 1 }}
39
- className="text-center"
40
  >
41
- <h2 className="mb-4 text-2xl font-semibold text-gray-900">{t.guess.title}</h2>
42
- <div className="mb-6 rounded-lg bg-gray-50 p-4">
43
- <p className="mb-4 text-lg text-gray-800">
44
- {t.guess.sentence}: {sentence.join(" ")}
45
- </p>
46
- <p className="text-xl font-bold text-primary">
47
- {t.guess.aiGuessed}: {aiGuess}
48
- </p>
49
- <p className="mt-4 text-lg">
50
- {isGuessCorrect() ? (
51
- <span className="text-green-600">{t.guess.correct}</span>
52
- ) : (
53
- <span className="text-red-600">{t.guess.incorrect}</span>
54
- )}
55
- </p>
56
  </div>
57
- <div className="flex flex-col gap-4">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
58
  {isGuessCorrect() ? (
59
  <Button
60
  onClick={onNextRound}
 
36
  <motion.div
37
  initial={{ opacity: 0 }}
38
  animate={{ opacity: 1 }}
39
+ className="text-center relative"
40
  >
41
+ <div className="absolute right-0 top-0 bg-primary/10 px-3 py-1 rounded-lg">
42
+ <span className="text-sm font-medium text-primary">
43
+ {t.game.round} {currentScore + 1}
44
+ </span>
 
 
 
 
 
 
 
 
 
 
 
45
  </div>
46
+
47
+ <h2 className="mb-4 text-2xl font-semibold text-gray-900">Think in Sync</h2>
48
+
49
+ <div>
50
+ <p className="text-sm text-gray-600 mb-1">{t.guess.goalDescription}</p>
51
+ <div className="mb-6 overflow-hidden rounded-lg bg-secondary/10">
52
+ <p className="p-4 text-2xl font-bold tracking-wider text-secondary">
53
+ {currentWord}
54
+ </p>
55
+ </div>
56
+ </div>
57
+
58
+ <div className="space-y-4">
59
+ <div>
60
+ <p className="text-sm text-gray-600 mb-1">{t.guess.providedDescription}</p>
61
+ <div className="rounded-lg bg-gray-50">
62
+ <p className="p-4 text-2xl tracking-wider text-gray-800">
63
+ {sentence.join(" ")}
64
+ </p>
65
+ </div>
66
+ </div>
67
+
68
+ <div>
69
+ <p className="text-sm text-gray-600 mb-1">{t.guess.aiGuessedDescription}</p>
70
+ <div className={`rounded-lg p-4 ${isGuessCorrect() ? 'bg-green-50' : 'bg-red-50'}`}>
71
+ <p className={`text-2xl font-bold tracking-wider ${isGuessCorrect() ? 'text-green-600' : 'text-red-600'}`}>
72
+ {aiGuess}
73
+ </p>
74
+ </div>
75
+ </div>
76
+ </div>
77
+
78
+ <div className="mt-6 flex flex-col gap-4">
79
  {isGuessCorrect() ? (
80
  <Button
81
  onClick={onNextRound}
src/components/game/SentenceBuilder.tsx CHANGED
@@ -4,6 +4,17 @@ import { motion } from "framer-motion";
4
  import { KeyboardEvent, useRef, useEffect, useState } from "react";
5
  import { useToast } from "@/hooks/use-toast";
6
  import { useTranslation } from "@/hooks/useTranslation";
 
 
 
 
 
 
 
 
 
 
 
7
 
8
  interface SentenceBuilderProps {
9
  currentWord: string;
@@ -14,6 +25,7 @@ interface SentenceBuilderProps {
14
  onInputChange: (value: string) => void;
15
  onSubmitWord: (e: React.FormEvent) => void;
16
  onMakeGuess: () => void;
 
17
  }
18
 
19
  export const SentenceBuilder = ({
@@ -25,9 +37,11 @@ export const SentenceBuilder = ({
25
  onInputChange,
26
  onSubmitWord,
27
  onMakeGuess,
 
28
  }: SentenceBuilderProps) => {
29
  const inputRef = useRef<HTMLInputElement>(null);
30
  const [imageLoaded, setImageLoaded] = useState(false);
 
31
  const imagePath = `/think_in_sync_assets/${currentWord.toLowerCase()}.jpg`;
32
  const { toast } = useToast();
33
  const t = useTranslation();
@@ -68,7 +82,6 @@ export const SentenceBuilder = ({
68
  const input = playerInput.trim().toLowerCase();
69
  const target = currentWord.toLowerCase();
70
 
71
- // Updated regex to allow letters with diacritics and special characters
72
  if (!/^[\p{L}]+$/u.test(input)) {
73
  toast({
74
  title: t.game.invalidWord,
@@ -90,57 +103,89 @@ export const SentenceBuilder = ({
90
  onSubmitWord(e);
91
  };
92
 
 
 
 
 
 
 
 
 
93
  return (
94
  <motion.div
95
  initial={{ opacity: 0 }}
96
  animate={{ opacity: 1 }}
97
- className="text-center"
98
  >
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
99
  <h2 className="mb-4 text-2xl font-semibold text-gray-900">
100
- {t.game.buildDescription}
101
  </h2>
102
- <p className="mb-6 text-sm text-gray-600">
103
- {t.game.buildSubtitle}
104
- </p>
105
- <div className="mb-4 overflow-hidden rounded-lg bg-secondary/10">
106
- {imageLoaded && (
107
- <img
108
- src={imagePath}
109
- alt={currentWord}
110
- className="mx-auto h-48 w-full object-cover"
111
- />
112
- )}
113
- <p className="p-4 text-2xl font-bold tracking-wider text-secondary">
114
- {currentWord}
115
- </p>
116
- </div>
117
- <div className="mb-6 rounded-lg bg-gray-50 p-4">
118
- <p className="text-lg text-gray-800">
119
- {sentence.length > 0 ? sentence.join(" ") : t.game.startSentence}
120
  </p>
 
 
 
 
 
 
 
 
 
 
 
 
121
  </div>
122
  <form onSubmit={handleSubmit} className="mb-4">
123
- <Input
124
- ref={inputRef}
125
- type="text"
126
- value={playerInput}
127
- onChange={(e) => {
128
- // Allow all letters including those with diacritics
129
- const value = e.target.value.replace(/[^a-zA-ZÀ-ÿ]/g, '');
130
- onInputChange(value);
131
- }}
132
- onKeyDown={handleKeyDown}
133
- placeholder={t.game.inputPlaceholder}
134
- className="mb-4"
135
- disabled={isAiThinking}
136
- />
 
 
 
 
 
 
 
 
 
 
 
 
137
  <div className="flex gap-4">
138
  <Button
139
  type="submit"
140
  className="flex-1 bg-primary text-lg hover:bg-primary/90"
141
  disabled={!playerInput.trim() || isAiThinking}
142
  >
143
- {isAiThinking ? t.game.aiThinking : t.game.addWord}
144
  </Button>
145
  <Button
146
  type="button"
@@ -148,10 +193,27 @@ export const SentenceBuilder = ({
148
  className="flex-1 bg-secondary text-lg hover:bg-secondary/90"
149
  disabled={(!sentence.length && !playerInput.trim()) || isAiThinking}
150
  >
151
- {isAiThinking ? t.game.aiThinking : t.game.makeGuess}
152
  </Button>
153
  </div>
154
  </form>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
155
  </motion.div>
156
  );
157
  };
 
4
  import { KeyboardEvent, useRef, useEffect, useState } from "react";
5
  import { useToast } from "@/hooks/use-toast";
6
  import { useTranslation } from "@/hooks/useTranslation";
7
+ import { House } from "lucide-react";
8
+ import {
9
+ AlertDialog,
10
+ AlertDialogAction,
11
+ AlertDialogCancel,
12
+ AlertDialogContent,
13
+ AlertDialogDescription,
14
+ AlertDialogFooter,
15
+ AlertDialogHeader,
16
+ AlertDialogTitle,
17
+ } from "@/components/ui/alert-dialog";
18
 
19
  interface SentenceBuilderProps {
20
  currentWord: string;
 
25
  onInputChange: (value: string) => void;
26
  onSubmitWord: (e: React.FormEvent) => void;
27
  onMakeGuess: () => void;
28
+ onBack?: () => void;
29
  }
30
 
31
  export const SentenceBuilder = ({
 
37
  onInputChange,
38
  onSubmitWord,
39
  onMakeGuess,
40
+ onBack,
41
  }: SentenceBuilderProps) => {
42
  const inputRef = useRef<HTMLInputElement>(null);
43
  const [imageLoaded, setImageLoaded] = useState(false);
44
+ const [showConfirmDialog, setShowConfirmDialog] = useState(false);
45
  const imagePath = `/think_in_sync_assets/${currentWord.toLowerCase()}.jpg`;
46
  const { toast } = useToast();
47
  const t = useTranslation();
 
82
  const input = playerInput.trim().toLowerCase();
83
  const target = currentWord.toLowerCase();
84
 
 
85
  if (!/^[\p{L}]+$/u.test(input)) {
86
  toast({
87
  title: t.game.invalidWord,
 
103
  onSubmitWord(e);
104
  };
105
 
106
+ const handleHomeClick = () => {
107
+ if (successfulRounds > 0) {
108
+ setShowConfirmDialog(true);
109
+ } else {
110
+ onBack?.();
111
+ }
112
+ };
113
+
114
  return (
115
  <motion.div
116
  initial={{ opacity: 0 }}
117
  animate={{ opacity: 1 }}
118
+ className="text-center relative"
119
  >
120
+ <div className="absolute right-0 top-0 bg-primary/10 px-3 py-1 rounded-lg">
121
+ <span className="text-sm font-medium text-primary">
122
+ {t.game.round} {successfulRounds + 1}
123
+ </span>
124
+ </div>
125
+
126
+ <Button
127
+ variant="ghost"
128
+ size="icon"
129
+ className="absolute left-0 top-0 text-gray-600 hover:text-primary"
130
+ onClick={handleHomeClick}
131
+ >
132
+ <House className="h-5 w-5" />
133
+ </Button>
134
+
135
  <h2 className="mb-4 text-2xl font-semibold text-gray-900">
136
+ Think in Sync
137
  </h2>
138
+ <div>
139
+ <p className="mb-1 text-sm text-gray-600">
140
+ {t.game.describeWord}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
141
  </p>
142
+ <div className="mb-6 overflow-hidden rounded-lg bg-secondary/10">
143
+ {imageLoaded && (
144
+ <img
145
+ src={imagePath}
146
+ alt={currentWord}
147
+ className="mx-auto h-48 w-full object-cover"
148
+ />
149
+ )}
150
+ <p className="p-4 text-2xl font-bold tracking-wider text-secondary">
151
+ {currentWord}
152
+ </p>
153
+ </div>
154
  </div>
155
  <form onSubmit={handleSubmit} className="mb-4">
156
+ {sentence.length > 0 && (
157
+ <motion.div
158
+ initial={{ opacity: 0, y: -10 }}
159
+ animate={{ opacity: 1, y: 0 }}
160
+ className="mb-4 text-left p-3 rounded-lg bg-gray-50"
161
+ >
162
+ <p className="text-gray-700">
163
+ {sentence.join(" ")}
164
+ </p>
165
+ </motion.div>
166
+ )}
167
+ <div className="relative mb-4">
168
+ <Input
169
+ ref={inputRef}
170
+ type="text"
171
+ value={playerInput}
172
+ onChange={(e) => {
173
+ const value = e.target.value.replace(/[^a-zA-ZÀ-ÿ]/g, '');
174
+ onInputChange(value);
175
+ }}
176
+ onKeyDown={handleKeyDown}
177
+ placeholder={t.game.inputPlaceholder}
178
+ className="w-full"
179
+ disabled={isAiThinking}
180
+ />
181
+ </div>
182
  <div className="flex gap-4">
183
  <Button
184
  type="submit"
185
  className="flex-1 bg-primary text-lg hover:bg-primary/90"
186
  disabled={!playerInput.trim() || isAiThinking}
187
  >
188
+ {isAiThinking ? t.game.aiThinking : `${t.game.addWord} ⏎`}
189
  </Button>
190
  <Button
191
  type="button"
 
193
  className="flex-1 bg-secondary text-lg hover:bg-secondary/90"
194
  disabled={(!sentence.length && !playerInput.trim()) || isAiThinking}
195
  >
196
+ {isAiThinking ? t.game.aiThinking : `${t.game.makeGuess} ⇧⏎`}
197
  </Button>
198
  </div>
199
  </form>
200
+
201
+ <AlertDialog open={showConfirmDialog} onOpenChange={setShowConfirmDialog}>
202
+ <AlertDialogContent>
203
+ <AlertDialogHeader>
204
+ <AlertDialogTitle>{t.game.leaveGameTitle}</AlertDialogTitle>
205
+ <AlertDialogDescription>
206
+ {t.game.leaveGameDescription}
207
+ </AlertDialogDescription>
208
+ </AlertDialogHeader>
209
+ <AlertDialogFooter>
210
+ <AlertDialogCancel>{t.game.cancel}</AlertDialogCancel>
211
+ <AlertDialogAction onClick={() => onBack?.()}>
212
+ {t.game.confirm}
213
+ </AlertDialogAction>
214
+ </AlertDialogFooter>
215
+ </AlertDialogContent>
216
+ </AlertDialog>
217
  </motion.div>
218
  );
219
  };
src/i18n/translations/de.ts CHANGED
@@ -1,97 +1,99 @@
1
  export const de = {
2
- welcome: {
3
- title: "Denken im Einklang",
4
- subtitle: "In diesem Spiel arbeiten Sie mit KI zusammen, um geheime Wörter zu erraten!",
5
- startButton: "Spiel Starten",
6
- howToPlay: "Spielanleitung",
7
- leaderboard: "Bestenliste",
8
- credits: "Erstellt von Sandro, Alessandro, Mattia, Michael, Emiliano und Felix beim",
9
- helpWin: "Helfen Sie uns einen Preis zu gewinnen",
10
- onHuggingface: "unser Projekt auf huggingface"
11
- },
12
- howToPlay: {
13
- setup: {
14
- title: "Der Aufbau",
15
- description: "Sie arbeiten mit zwei KIs: eine als Partner, der Hinweise gibt, und eine andere, die versucht, das Wort zu erraten."
 
 
 
 
16
  },
17
- goal: {
18
- title: "Ihr Ziel",
19
- description: "Helfen Sie der KI, das geheime Wort mit Einwort-Hinweisen zu erraten. Jede richtige Vermutung bringt Ihnen einen Punkt!"
20
- },
21
- rules: {
22
- title: "Die Regeln",
23
- items: [
24
- "Nur ein Wort pro Hinweis",
25
- "Keine Teile des geheimen Wortes oder Übersetzungen",
26
- "Hinweise müssen sich auf das Wort beziehen (seien Sie kreativ!)",
27
- "Keine Buchstabierung der Antwort"
28
- ]
 
 
 
 
 
 
 
 
 
 
 
29
  }
30
  },
31
- game: {
32
- buildDescription: "Beschreibung Erstellen",
33
- buildSubtitle: "Wechseln Sie sich mit der KI ab, um Ihr Wort zu beschreiben, ohne das Wort selbst zu verwenden!",
34
- startSentence: "Beginnen Sie Ihren Satz...",
35
- inputPlaceholder: "Geben Sie Ihr Wort ein (nur Buchstaben)...",
36
- addWord: "Wort Hinzufügen",
37
- makeGuess: "KI Raten Lassen",
38
- aiThinking: "KI denkt nach...",
39
- aiDelayed: "Die KI ist derzeit beschäftigt. Bitte versuchen Sie es in einem Moment erneut.",
40
- invalidWord: "Ungültiges Wort",
41
- cantUseTargetWord: "Sie können keine Wörter verwenden, die enthalten",
42
- lettersOnly: "Bitte verwenden Sie nur Buchstaben (keine Zahlen oder Sonderzeichen)"
43
- },
44
  guess: {
45
  title: "KI-Vermutung",
46
- sentence: "Ihr Satz",
47
- aiGuessed: "KI hat geraten",
48
- correct: "Richtig geraten! 🎉 Bereit für die nächste Runde? Drücken Sie Enter",
49
- incorrect: "Spiel vorbei! Drücken Sie Enter zum Neustart",
 
50
  nextRound: "Nächste Runde",
51
- playAgain: "Erneut Spielen",
52
- viewLeaderboard: "Bestenliste Anzeigen"
53
- },
54
- gameOver: {
55
- title: "Spiel Vorbei!",
56
- completedRounds: "Sie haben {count} Runden erfolgreich abgeschlossen!",
57
- playAgain: "Erneut Spielen"
58
  },
59
  themes: {
60
- title: "Thema Wählen",
61
- subtitle: "Wählen Sie ein Thema für Ihr Wörter-Rate-Abenteuer",
62
- standard: "",
63
  technology: "Technologie",
64
  sports: "Sport",
65
  food: "Essen",
66
- custom: "Wählen Sie Ihr Thema",
67
- customPlaceholder: "Geben Sie ein Thema ein (z.B. Tiere, Filme)",
68
  continue: "Weiter",
69
- generating: "Generiere thematische Wörter...",
70
- pressKey: "Drücken Sie"
71
  },
72
- leaderboard: {
73
- title: "Bestenliste",
74
- yourScore: "Ihre Punktzahl",
75
- roundCount: "Runden",
76
- wordsPerRound: "Wörter/Runde",
77
- enterName: "Geben Sie Ihren Namen ein (nur Buchstaben und Zahlen)",
78
- submit: "Punktzahl Einreichen",
79
- submitting: "Wird eingereicht...",
80
- rank: "Rang",
81
- player: "Spieler",
82
- roundsColumn: "Runden",
83
- avgWords: "Durchschn. Wörter/Runde",
84
- noScores: "Noch keine Highscores. Seien Sie der Erste!",
85
- previous: "Zurück",
86
- next: "Weiter",
87
- error: {
88
- invalidName: "Bitte geben Sie einen gültigen Namen ein (nur Buchstaben und Zahlen)",
89
- noRounds: "Sie müssen mindestens eine Runde abschließen, um eine Punktzahl einzureichen",
90
- alreadySubmitted: "Sie haben Ihre Punktzahl für dieses Spiel bereits eingereicht",
91
- newHighScore: "Neuer Highscore!",
92
- beatRecord: "Sie haben Ihren bisherigen Rekord von {score} Runden übertroffen!",
93
- notHigher: "Ihre aktuelle Punktzahl ({current}) ist nicht höher als Ihre beste Punktzahl ({best})",
94
- submitError: "Fehler beim Einreichen der Punktzahl. Bitte versuchen Sie es erneut."
 
 
 
 
95
  }
96
  }
97
  };
 
1
  export const de = {
2
+ game: {
3
+ round: "Runde",
4
+ buildDescription: "Baut gemeinsam einen Satz",
5
+ buildSubtitle: "Fügt abwechselnd Wörter hinzu, um einen Satz zu bilden",
6
+ startSentence: "Beginne deinen Satz...",
7
+ inputPlaceholder: "Gib ein Wort ein...",
8
+ addWord: "Wort hinzufügen",
9
+ makeGuess: "Raten",
10
+ aiThinking: "KI denkt nach...",
11
+ aiDelayed: "Die KI ist derzeit beschäftigt. Bitte versuche es gleich noch einmal.",
12
+ invalidWord: "Ungültiges Wort",
13
+ cantUseTargetWord: "Du kannst das Zielwort nicht verwenden",
14
+ lettersOnly: "Bitte nur Buchstaben verwenden",
15
+ leaveGameTitle: "Spiel verlassen?",
16
+ leaveGameDescription: "Dein aktueller Fortschritt geht verloren. Bist du sicher, dass du das Spiel verlassen möchtest?",
17
+ cancel: "Abbrechen",
18
+ confirm: "Bestätigen",
19
+ describeWord: "Dein Ziel ist es folgendes Wort zu beschreiben"
20
  },
21
+ leaderboard: {
22
+ title: "Bestenliste",
23
+ yourScore: "Deine Punktzahl",
24
+ roundCount: "Runden",
25
+ wordsPerRound: "Wörter pro Runde",
26
+ enterName: "Gib deinen Namen ein",
27
+ submitting: "Wird übermittelt...",
28
+ submit: "Punktzahl einreichen",
29
+ rank: "Rang",
30
+ player: "Spieler",
31
+ roundsColumn: "Runden",
32
+ avgWords: "Durchschn. Wörter",
33
+ noScores: "Noch keine Punktzahlen",
34
+ previous: "Vorherige",
35
+ next: "Nächste",
36
+ error: {
37
+ invalidName: "Bitte gib einen gültigen Namen ein",
38
+ noRounds: "Du musst mindestens eine Runde abschließen",
39
+ alreadySubmitted: "Punktzahl bereits eingereicht",
40
+ newHighScore: "Neuer Highscore!",
41
+ beatRecord: "Du hast deinen bisherigen Rekord von {score} geschlagen!",
42
+ notHigher: "Punktzahl von {current} nicht höher als dein Bester von {best}",
43
+ submitError: "Fehler beim Einreichen der Punktzahl"
44
  }
45
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
46
  guess: {
47
  title: "KI-Vermutung",
48
+ goalDescription: "Dein Ziel war es folgendes Wort zu beschreiben",
49
+ providedDescription: "Du hast folgende Beschreibung gegeben",
50
+ aiGuessedDescription: "Basierend auf deiner Beschreibung hat die KI geraten",
51
+ correct: "Das ist richtig!",
52
+ incorrect: "Das ist falsch.",
53
  nextRound: "Nächste Runde",
54
+ playAgain: "Erneut spielen",
55
+ viewLeaderboard: "In Bestenliste eintragen"
 
 
 
 
 
56
  },
57
  themes: {
58
+ title: "Wähle ein Thema",
59
+ subtitle: "Wähle ein Thema für das Wort, das die KI erraten soll",
60
+ standard: "Standard",
61
  technology: "Technologie",
62
  sports: "Sport",
63
  food: "Essen",
64
+ custom: "Benutzerdefiniertes Thema",
65
+ customPlaceholder: "Gib dein eigenes Thema ein...",
66
  continue: "Weiter",
67
+ generating: "Wird generiert...",
68
+ pressKey: "Drücke"
69
  },
70
+ welcome: {
71
+ title: "Think in Sync",
72
+ subtitle: "Baue Sätze zusammen und lass die KI dein Wort erraten!",
73
+ startButton: "Spiel starten",
74
+ howToPlay: "Spielanleitung",
75
+ leaderboard: "Bestenliste",
76
+ credits: "Erstellt während des",
77
+ helpWin: "Hilf uns gewinnen",
78
+ onHuggingface: " auf Huggingface"
79
+ },
80
+ howToPlay: {
81
+ setup: {
82
+ title: "Vorbereitung",
83
+ description: "Wähle ein Thema und erhalte ein geheimes Wort, das die KI erraten soll."
84
+ },
85
+ goal: {
86
+ title: "Ziel",
87
+ description: "Baue gemeinsam mit der KI Sätze, die dein Wort beschreiben, ohne es direkt zu verwenden."
88
+ },
89
+ rules: {
90
+ title: "Regeln",
91
+ items: [
92
+ "Füge abwechselnd Wörter hinzu, um beschreibende Sätze zu bilden",
93
+ "Verwende nicht das geheime Wort oder seine Variationen",
94
+ "Sei kreativ und beschreibend",
95
+ "Die KI wird nach jedem Satz versuchen, dein Wort zu erraten"
96
+ ]
97
  }
98
  }
99
  };
src/i18n/translations/en.ts CHANGED
@@ -1,97 +1,99 @@
1
  export const en = {
2
- welcome: {
3
- title: "Think in Sync",
4
- subtitle: "In this game you team up with AI to guess secret words!",
5
- startButton: "Start Game",
6
- howToPlay: "How to Play",
7
- leaderboard: "Leaderboard",
8
- credits: "Made by Sandro, Alessandro, Mattia, Michael, Emiliano, and Felix at",
9
- helpWin: "Help us win a price by",
10
- onHuggingface: "our project on huggingface"
11
- },
12
- howToPlay: {
13
- setup: {
14
- title: "The Setup",
15
- description: "You'll work with two AIs: one as your partner giving clues, and another trying to guess the word."
16
- },
17
- goal: {
18
- title: "Your Goal",
19
- description: "Help the AI guess the secret word using one-word clues. Each correct guess earns you a point!"
20
  },
21
- rules: {
22
- title: "The Rules",
23
- items: [
24
- "One word per clue only",
25
- "No parts of the secret word or translations",
26
- "Clues must relate to the word (be creative!)",
27
- "No spelling out the answer"
28
- ]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
29
  }
30
  },
31
- game: {
32
- buildDescription: "Build a Description",
33
- buildSubtitle: "Take turns with AI to describe your word without using the word itself!",
34
- startSentence: "Start your sentence...",
35
- inputPlaceholder: "Enter your word (letters only)...",
36
- addWord: "Add Word",
37
- makeGuess: "Make AI Guess",
38
- aiThinking: "AI is thinking...",
39
- aiDelayed: "The AI is currently busy. Please try again in a moment.",
40
- invalidWord: "Invalid Word",
41
- cantUseTargetWord: "You cannot use words that contain",
42
- lettersOnly: "Please use only letters (no numbers or special characters)"
43
- },
44
  guess: {
45
  title: "AI's Guess",
46
- sentence: "Your sentence",
47
- aiGuessed: "AI guessed",
48
- correct: "Correct guess! 🎉 Ready for the next round? Press Enter",
49
- incorrect: "Game Over! Press Enter to play again",
 
50
  nextRound: "Next Round",
51
  playAgain: "Play Again",
52
- viewLeaderboard: "View Leaderboard"
53
- },
54
- gameOver: {
55
- title: "Game Over!",
56
- completedRounds: "You completed {count} rounds successfully!",
57
- playAgain: "Play Again"
58
  },
59
  themes: {
60
  title: "Choose a Theme",
61
- subtitle: "Select a theme for your word-guessing adventure",
62
  standard: "Standard",
63
  technology: "Technology",
64
  sports: "Sports",
65
  food: "Food",
66
- custom: "Choose your theme",
67
- customPlaceholder: "Enter a theme (e.g., Animals, Movies)",
68
  continue: "Continue",
69
- generating: "Generating themed words...",
70
  pressKey: "Press"
71
  },
72
- leaderboard: {
73
- title: "Leaderboard",
74
- yourScore: "Your score",
75
- roundCount: "rounds",
76
- wordsPerRound: "words/round",
77
- enterName: "Enter your name (letters and numbers only)",
78
- submit: "Submit Score",
79
- submitting: "Submitting...",
80
- rank: "Rank",
81
- player: "Player",
82
- roundsColumn: "Rounds",
83
- avgWords: "Avg Words/Round",
84
- noScores: "No high scores yet. Be the first!",
85
- previous: "Previous",
86
- next: "Next",
87
- error: {
88
- invalidName: "Please enter a valid name (only letters and numbers allowed)",
89
- noRounds: "You need to complete at least one round to submit a score",
90
- alreadySubmitted: "You have already submitted your score for this game",
91
- newHighScore: "New High Score!",
92
- beatRecord: "You beat your previous record of {score} rounds!",
93
- notHigher: "Your current score ({current}) is not higher than your best score ({best})",
94
- submitError: "Failed to submit score. Please try again."
 
 
 
 
95
  }
96
  }
97
  };
 
1
  export const en = {
2
+ game: {
3
+ round: "Round",
4
+ buildDescription: "Build a sentence together",
5
+ buildSubtitle: "Take turns adding words to create a sentence",
6
+ startSentence: "Start building your sentence...",
7
+ inputPlaceholder: "Enter a word...",
8
+ addWord: "Add Word",
9
+ makeGuess: "Make Guess",
10
+ aiThinking: "AI is thinking...",
11
+ aiDelayed: "The AI is currently busy. Please try again in a moment.",
12
+ invalidWord: "Invalid Word",
13
+ cantUseTargetWord: "You can't use the target word",
14
+ lettersOnly: "Please use letters only",
15
+ leaveGameTitle: "Leave Game?",
16
+ leaveGameDescription: "Your current progress will be lost. Are you sure you want to leave?",
17
+ cancel: "Cancel",
18
+ confirm: "Confirm",
19
+ describeWord: "Your goal is to describe the word"
20
  },
21
+ leaderboard: {
22
+ title: "High Scores",
23
+ yourScore: "Your Score",
24
+ roundCount: "rounds",
25
+ wordsPerRound: "words per round",
26
+ enterName: "Enter your name",
27
+ submitting: "Submitting...",
28
+ submit: "Submit Score",
29
+ rank: "Rank",
30
+ player: "Player",
31
+ roundsColumn: "Rounds",
32
+ avgWords: "Avg. Words",
33
+ noScores: "No scores yet",
34
+ previous: "Previous",
35
+ next: "Next",
36
+ error: {
37
+ invalidName: "Please enter a valid name",
38
+ noRounds: "You need to complete at least one round",
39
+ alreadySubmitted: "Score already submitted",
40
+ newHighScore: "New High Score!",
41
+ beatRecord: "You beat your previous record of {score}!",
42
+ notHigher: "Score of {current} not higher than your best of {best}",
43
+ submitError: "Error submitting score"
44
  }
45
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
46
  guess: {
47
  title: "AI's Guess",
48
+ goalDescription: "Your goal was to describe the word",
49
+ providedDescription: "You provided the description",
50
+ aiGuessedDescription: "Based on your description, the AI guessed",
51
+ correct: "This is right!",
52
+ incorrect: "This is wrong.",
53
  nextRound: "Next Round",
54
  playAgain: "Play Again",
55
+ viewLeaderboard: "Safe your score"
 
 
 
 
 
56
  },
57
  themes: {
58
  title: "Choose a Theme",
59
+ subtitle: "Select a theme for the word the AI will try to guess",
60
  standard: "Standard",
61
  technology: "Technology",
62
  sports: "Sports",
63
  food: "Food",
64
+ custom: "Custom Theme",
65
+ customPlaceholder: "Enter your custom theme...",
66
  continue: "Continue",
67
+ generating: "Generating...",
68
  pressKey: "Press"
69
  },
70
+ welcome: {
71
+ title: "Think in Sync",
72
+ subtitle: "Build sentences together and let AI guess your word!",
73
+ startButton: "Start Game",
74
+ howToPlay: "How to Play",
75
+ leaderboard: "Leaderboard",
76
+ credits: "Created during the",
77
+ helpWin: "Help us win by",
78
+ onHuggingface: "Starring on Huggingface"
79
+ },
80
+ howToPlay: {
81
+ setup: {
82
+ title: "Setup",
83
+ description: "Choose a theme and get a secret word that the AI will try to guess."
84
+ },
85
+ goal: {
86
+ title: "Goal",
87
+ description: "Build sentences together with the AI that describe your word without using it directly."
88
+ },
89
+ rules: {
90
+ title: "Rules",
91
+ items: [
92
+ "Take turns adding words to build descriptive sentences",
93
+ "Don't use the secret word or its variations",
94
+ "Try to be creative and descriptive",
95
+ "The AI will try to guess your word after each sentence"
96
+ ]
97
  }
98
  }
99
  };
src/i18n/translations/es.ts CHANGED
@@ -1,97 +1,99 @@
1
  export const es = {
2
- welcome: {
3
- title: "Pensar en Sintonía",
4
- subtitle: "¡En este juego te unes a la IA para adivinar palabras secretas!",
5
- startButton: "Comenzar Juego",
6
- howToPlay: "Cómo Jugar",
7
- leaderboard: "Clasificación",
8
- credits: "Creado por Sandro, Alessandro, Mattia, Michael, Emiliano y Felix en el",
9
- helpWin: "Ayúdanos a ganar un premio",
10
- onHuggingface: "nuestro proyecto en huggingface"
11
- },
12
- howToPlay: {
13
- setup: {
14
- title: "La Configuración",
15
- description: "Trabajarás con dos IAs: una como compañera dando pistas y otra intentando adivinar la palabra."
16
- },
17
- goal: {
18
- title: "Tu Objetivo",
19
- description: "Ayuda a la IA a adivinar la palabra secreta usando pistas de una sola palabra. ¡Cada adivinanza correcta te da un punto!"
20
  },
21
- rules: {
22
- title: "Las Reglas",
23
- items: [
24
- "Solo una palabra por pista",
25
- "No usar partes de la palabra secreta ni traducciones",
26
- "Las pistas deben relacionarse con la palabra (¡sé creativo!)",
27
- "No deletrear la respuesta"
28
- ]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
29
  }
30
  },
31
- game: {
32
- buildDescription: "Construye una Descripción",
33
- buildSubtitle: "¡Alterna con la IA para describir tu palabra sin usar la palabra misma!",
34
- startSentence: "Comienza tu frase...",
35
- inputPlaceholder: "Ingresa tu palabra (solo letras)...",
36
- addWord: "Agregar Palabra",
37
- makeGuess: "Hacer que la IA Adivine",
38
- aiThinking: "La IA está pensando...",
39
- aiDelayed: "La IA está ocupada en este momento. Por favor, inténtalo de nuevo en un momento.",
40
- invalidWord: "Palabra Inválida",
41
- cantUseTargetWord: "No puedes usar palabras que contengan",
42
- lettersOnly: "Por favor usa solo letras (sin números ni caracteres especiales)"
43
- },
44
  guess: {
45
- title: "Intento de la IA",
46
- sentence: "Tu frase",
47
- aiGuessed: "La IA adivinó",
48
- correct: "¡Adivinanza correcta! 🎉 ¿Listo para la siguiente ronda? Presiona Enter",
49
- incorrect: "¡Juego terminado! Presiona Enter para jugar de nuevo",
 
50
  nextRound: "Siguiente Ronda",
51
  playAgain: "Jugar de Nuevo",
52
  viewLeaderboard: "Ver Clasificación"
53
  },
54
- gameOver: {
55
- title: "¡Juego Terminado!",
56
- completedRounds: "¡Completaste {count} rondas exitosamente!",
57
- playAgain: "Jugar de Nuevo"
58
- },
59
  themes: {
60
- title: "Elegir un Tema",
61
- subtitle: "Selecciona un tema para tu aventura de adivinanzas",
62
- standard: "",
63
  technology: "Tecnología",
64
  sports: "Deportes",
65
  food: "Comida",
66
- custom: "Elige tu tema",
67
- customPlaceholder: "Ingresa un tema (ej: Animales, Películas)",
68
  continue: "Continuar",
69
- generating: "Generando palabras temáticas...",
70
  pressKey: "Presiona"
71
  },
72
- leaderboard: {
73
- title: "Clasificación",
74
- yourScore: "Tu puntaje",
75
- roundCount: "rondas",
76
- wordsPerRound: "palabras/ronda",
77
- enterName: "Ingresa tu nombre (solo letras y números)",
78
- submit: "Enviar Puntaje",
79
- submitting: "Enviando...",
80
- rank: "Posición",
81
- player: "Jugador",
82
- roundsColumn: "Rondas",
83
- avgWords: "Prom. Palabras/Ronda",
84
- noScores: "Aún no hay puntajes altos. ¡Sé el primero!",
85
- previous: "Anterior",
86
- next: "Siguiente",
87
- error: {
88
- invalidName: "Por favor ingresa un nombre válido (solo letras y números)",
89
- noRounds: "Necesitas completar al menos una ronda para enviar un puntaje",
90
- alreadySubmitted: "Ya has enviado tu puntaje para este juego",
91
- newHighScore: "¡Nuevo Récord!",
92
- beatRecord: "¡Superaste tu récord anterior de {score} rondas!",
93
- notHigher: "Tu puntaje actual ({current}) no es mayor que tu mejor puntaje ({best})",
94
- submitError: "Error al enviar el puntaje. Por favor intenta de nuevo."
 
 
 
 
95
  }
96
  }
97
  };
 
1
  export const es = {
2
+ game: {
3
+ round: "Ronda",
4
+ buildDescription: "Construyan una frase juntos",
5
+ buildSubtitle: "Añadan palabras por turnos para crear una frase",
6
+ startSentence: "Empieza a construir tu frase...",
7
+ inputPlaceholder: "Ingresa una palabra...",
8
+ addWord: "Añadir palabra",
9
+ makeGuess: "Adivinar",
10
+ aiThinking: "La IA está pensando...",
11
+ aiDelayed: "La IA está ocupada en este momento. Por favor, inténtalo de nuevo en un momento.",
12
+ invalidWord: "Palabra inválida",
13
+ cantUseTargetWord: "No puedes usar la palabra objetivo",
14
+ lettersOnly: "Por favor, usa solo letras",
15
+ leaveGameTitle: "¿Salir del juego?",
16
+ leaveGameDescription: "Tu progreso actual se perderá. ¿Estás seguro de que quieres salir?",
17
+ cancel: "Cancelar",
18
+ confirm: "Confirmar",
19
+ describeWord: "Tu objetivo es describir la palabra"
20
  },
21
+ leaderboard: {
22
+ title: "Puntuaciones Más Altas",
23
+ yourScore: "Tu Puntuación",
24
+ roundCount: "rondas",
25
+ wordsPerRound: "palabras por ronda",
26
+ enterName: "Ingresa tu nombre",
27
+ submitting: "Enviando...",
28
+ submit: "Enviar Puntuación",
29
+ rank: "Posición",
30
+ player: "Jugador",
31
+ roundsColumn: "Rondas",
32
+ avgWords: "Prom. Palabras",
33
+ noScores: "Aún no hay puntuaciones",
34
+ previous: "Anterior",
35
+ next: "Siguiente",
36
+ error: {
37
+ invalidName: "Por favor, ingresa un nombre válido",
38
+ noRounds: "Debes completar al menos una ronda",
39
+ alreadySubmitted: "Puntuación ya enviada",
40
+ newHighScore: "¡Nueva Puntuación Más Alta!",
41
+ beatRecord: "¡Has superado tu récord anterior de {score}!",
42
+ notHigher: "Puntuación de {current} no superior a tu mejor de {best}",
43
+ submitError: "Error al enviar la puntuación"
44
  }
45
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
46
  guess: {
47
+ title: "Suposición de la IA",
48
+ goalDescription: "Tu objetivo era describir la palabra",
49
+ providedDescription: "Proporcionaste la descripción",
50
+ aiGuessedDescription: "Basado en tu descripción, la IA adivinó",
51
+ correct: "¡Esto es correcto!",
52
+ incorrect: "Esto es incorrecto.",
53
  nextRound: "Siguiente Ronda",
54
  playAgain: "Jugar de Nuevo",
55
  viewLeaderboard: "Ver Clasificación"
56
  },
 
 
 
 
 
57
  themes: {
58
+ title: "Elige un Tema",
59
+ subtitle: "Selecciona un tema para la palabra que la IA intentará adivinar",
60
+ standard: "Estándar",
61
  technology: "Tecnología",
62
  sports: "Deportes",
63
  food: "Comida",
64
+ custom: "Tema Personalizado",
65
+ customPlaceholder: "Ingresa tu tema personalizado...",
66
  continue: "Continuar",
67
+ generating: "Generando...",
68
  pressKey: "Presiona"
69
  },
70
+ welcome: {
71
+ title: "Think in Sync",
72
+ subtitle: "¡Construye frases juntos y deja que la IA adivine tu palabra!",
73
+ startButton: "Comenzar Juego",
74
+ howToPlay: "Cómo Jugar",
75
+ leaderboard: "Clasificación",
76
+ credits: "Creado durante el",
77
+ helpWin: "Ayúdanos a ganar",
78
+ onHuggingface: "Dando una estrella en Huggingface"
79
+ },
80
+ howToPlay: {
81
+ setup: {
82
+ title: "Preparación",
83
+ description: "Elige un tema y obtén una palabra secreta que la IA intentará adivinar."
84
+ },
85
+ goal: {
86
+ title: "Objetivo",
87
+ description: "Construye frases junto con la IA que describan tu palabra sin usarla directamente."
88
+ },
89
+ rules: {
90
+ title: "Reglas",
91
+ items: [
92
+ "Añade palabras por turnos para construir frases descriptivas",
93
+ "No uses la palabra secreta o sus variaciones",
94
+ "Sé creativo y descriptivo",
95
+ "La IA intentará adivinar tu palabra después de cada frase"
96
+ ]
97
  }
98
  }
99
  };
src/i18n/translations/fr.ts CHANGED
@@ -1,97 +1,99 @@
1
  export const fr = {
2
- welcome: {
3
- title: "Penser en Sync",
4
- subtitle: "Dans ce jeu, vous faites équipe avec l'IA pour deviner des mots secrets !",
5
- startButton: "Commencer",
6
- howToPlay: "Comment Jouer",
7
- leaderboard: "Classement",
8
- credits: "Créé par Sandro, Alessandro, Mattia, Michael, Emiliano et Felix lors du",
9
- helpWin: "Aidez-nous à gagner un prix en",
10
- onHuggingface: "notre projet sur huggingface"
11
- },
12
- howToPlay: {
13
- setup: {
14
- title: "La Configuration",
15
- description: "Vous travaillerez avec deux IA : une comme partenaire donnant des indices, et une autre essayant de deviner le mot."
16
- },
17
- goal: {
18
- title: "Votre Objectif",
19
- description: "Aidez l'IA à deviner le mot secret en utilisant des indices d'un seul mot. Chaque devinette correcte vous rapporte un point !"
20
  },
21
- rules: {
22
- title: "Les Règles",
23
- items: [
24
- "Un seul mot par indice",
25
- "Pas de parties du mot secret ni de traductions",
26
- "Les indices doivent être liés au mot (soyez créatif !)",
27
- "Ne pas épeler la réponse"
28
- ]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
29
  }
30
  },
31
- game: {
32
- buildDescription: "Construire une Description",
33
- buildSubtitle: "Alternez avec l'IA pour décrire votre mot sans utiliser le mot lui-même !",
34
- startSentence: "Commencez votre phrase...",
35
- inputPlaceholder: "Entrez votre mot (lettres uniquement)...",
36
- addWord: "Ajouter un Mot",
37
- makeGuess: "Faire Deviner l'IA",
38
- aiThinking: "L'IA réfléchit...",
39
- aiDelayed: "L'IA est actuellement occupée. Veuillez réessayer dans un moment.",
40
- invalidWord: "Mot Invalide",
41
- cantUseTargetWord: "Vous ne pouvez pas utiliser des mots qui contiennent",
42
- lettersOnly: "Veuillez utiliser uniquement des lettres (pas de chiffres ni de caractères spéciaux)"
43
- },
44
  guess: {
45
  title: "Devinette de l'IA",
46
- sentence: "Votre phrase",
47
- aiGuessed: "L'IA a deviné",
48
- correct: "Devinette correcte ! 🎉 Prêt pour le prochain tour ? Appuyez sur Entrée",
49
- incorrect: "Partie terminée ! Appuyez sur Entrée pour rejouer",
 
50
  nextRound: "Tour Suivant",
51
  playAgain: "Rejouer",
52
- viewLeaderboard: "Voir le Classement"
53
- },
54
- gameOver: {
55
- title: "Partie Terminée !",
56
- completedRounds: "Vous avez complété {count} tours avec succès !",
57
- playAgain: "Rejouer"
58
  },
59
  themes: {
60
- title: "Choisir un Thème",
61
- subtitle: "Sélectionnez un thème pour votre aventure de devinettes",
62
- standard: "",
63
  technology: "Technologie",
64
  sports: "Sports",
65
  food: "Nourriture",
66
- custom: "Choisissez votre thème",
67
- customPlaceholder: "Entrez un thème (ex: Animaux, Films)",
68
  continue: "Continuer",
69
- generating: "Génération des mots thématiques...",
70
  pressKey: "Appuyez sur"
71
  },
72
- leaderboard: {
73
- title: "Classement",
74
- yourScore: "Votre score",
75
- roundCount: "tours",
76
- wordsPerRound: "mots/tour",
77
- enterName: "Entrez votre nom (lettres et chiffres uniquement)",
78
- submit: "Soumettre le Score",
79
- submitting: "Soumission...",
80
- rank: "Rang",
81
- player: "Joueur",
82
- roundsColumn: "Tours",
83
- avgWords: "Moy. Mots/Tour",
84
- noScores: "Pas encore de scores. Soyez le premier !",
85
- previous: "Précédent",
86
- next: "Suivant",
87
- error: {
88
- invalidName: "Veuillez entrer un nom valide (uniquement lettres et chiffres)",
89
- noRounds: "Vous devez compléter au moins un tour pour soumettre un score",
90
- alreadySubmitted: "Vous avez déjà soumis votre score pour cette partie",
91
- newHighScore: "Nouveau Record !",
92
- beatRecord: "Vous avez battu votre record précédent de {score} tours !",
93
- notHigher: "Votre score actuel ({current}) n'est pas supérieur à votre meilleur score ({best})",
94
- submitError: "Échec de la soumission du score. Veuillez réessayer."
 
 
 
 
95
  }
96
  }
97
  };
 
 
1
  export const fr = {
2
+ game: {
3
+ round: "Tour",
4
+ buildDescription: "Construisez une phrase ensemble",
5
+ startSentence: "Commencez à construire votre phrase...",
6
+ inputPlaceholder: "Entrez un mot...",
7
+ addWord: "Ajouter un mot",
8
+ makeGuess: "Deviner",
9
+ aiThinking: "L'IA réfléchit...",
10
+ aiDelayed: "L'IA est actuellement occupée. Veuillez réessayer dans un moment.",
11
+ invalidWord: "Mot invalide",
12
+ cantUseTargetWord: "Vous ne pouvez pas utiliser le mot cible",
13
+ lettersOnly: "Veuillez utiliser uniquement des lettres",
14
+ leaveGameTitle: "Quitter le jeu ?",
15
+ leaveGameDescription: "Votre progression actuelle sera perdue. Êtes-vous sûr de vouloir quitter ?",
16
+ cancel: "Annuler",
17
+ confirm: "Confirmer",
18
+ describeWord: "Votre objectif est de décrire le mot"
 
19
  },
20
+ leaderboard: {
21
+ title: "Meilleurs Scores",
22
+ yourScore: "Votre Score",
23
+ roundCount: "tours",
24
+ wordsPerRound: "mots par tour",
25
+ enterName: "Entrez votre nom",
26
+ submitting: "Envoi en cours...",
27
+ submit: "Soumettre le Score",
28
+ rank: "Rang",
29
+ player: "Joueur",
30
+ roundsColumn: "Tours",
31
+ avgWords: "Moy. Mots",
32
+ noScores: "Pas encore de scores",
33
+ previous: "Précédent",
34
+ next: "Suivant",
35
+ error: {
36
+ invalidName: "Veuillez entrer un nom valide",
37
+ noRounds: "Vous devez compléter au moins un tour",
38
+ alreadySubmitted: "Score déjà soumis",
39
+ newHighScore: "Nouveau Record !",
40
+ beatRecord: "Vous avez battu votre record précédent de {score} !",
41
+ notHigher: "Score de {current} pas plus élevé que votre meilleur de {best}",
42
+ submitError: "Erreur lors de la soumission du score"
43
  }
44
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
45
  guess: {
46
  title: "Devinette de l'IA",
47
+ goalDescription: "Votre objectif était de décrire le mot",
48
+ providedDescription: "Vous avez fourni la description",
49
+ aiGuessedDescription: "Basé sur votre description, l'IA a deviné",
50
+ correct: "C'est correct !",
51
+ incorrect: "C'est incorrect.",
52
  nextRound: "Tour Suivant",
53
  playAgain: "Rejouer",
54
+ viewLeaderboard: "Voir les Scores"
 
 
 
 
 
55
  },
56
  themes: {
57
+ title: "Choisissez un Thème",
58
+ subtitle: "Sélectionnez un thème pour le mot que l'IA essaiera de deviner",
59
+ standard: "Standard",
60
  technology: "Technologie",
61
  sports: "Sports",
62
  food: "Nourriture",
63
+ custom: "Thème Personnalisé",
64
+ customPlaceholder: "Entrez votre thème personnalisé...",
65
  continue: "Continuer",
66
+ generating: "Génération...",
67
  pressKey: "Appuyez sur"
68
  },
69
+ welcome: {
70
+ title: "Think in Sync",
71
+ subtitle: "Construisez des phrases ensemble et laissez l'IA deviner votre mot !",
72
+ startButton: "Commencer",
73
+ howToPlay: "Comment Jouer",
74
+ leaderboard: "Classement",
75
+ credits: "Créé pendant le",
76
+ helpWin: "Aidez-nous à gagner en",
77
+ onHuggingface: "Nous étoilant sur Huggingface"
78
+ },
79
+ howToPlay: {
80
+ setup: {
81
+ title: "Mise en place",
82
+ description: "Choisissez un thème et obtenez un mot secret que l'IA essaiera de deviner."
83
+ },
84
+ goal: {
85
+ title: "Objectif",
86
+ description: "Construisez des phrases avec l'IA qui décrivent votre mot sans l'utiliser directement."
87
+ },
88
+ rules: {
89
+ title: "Règles",
90
+ items: [
91
+ "Ajoutez des mots à tour de rôle pour construire des phrases descriptives",
92
+ "N'utilisez pas le mot secret ou ses variations",
93
+ "Soyez créatif et descriptif",
94
+ "L'IA essaiera de deviner votre mot après chaque phrase"
95
+ ]
96
  }
97
  }
98
  };
99
+
src/i18n/translations/it.ts CHANGED
@@ -1,97 +1,101 @@
1
  export const it = {
2
- welcome: {
3
- title: "Pensare in Sincronia",
4
- subtitle: "In questo gioco fai squadra con l'IA per indovinare parole segrete!",
5
- startButton: "Inizia Gioco",
6
- howToPlay: "Come Giocare",
7
- leaderboard: "Classifica",
8
- credits: "Creato da Sandro, Alessandro, Mattia, Michael, Emiliano e Felix all'",
9
- helpWin: "Aiutaci a vincere un premio",
10
- onHuggingface: "il nostro progetto su huggingface"
11
- },
12
- howToPlay: {
13
- setup: {
14
- title: "La Configurazione",
15
- description: "Lavorerai con due IA: una come partner che fornisce indizi e un'altra che cerca di indovinare la parola."
16
- },
17
- goal: {
18
- title: "Il tuo Obiettivo",
19
- description: "Aiuta l'IA a indovinare la parola segreta usando indizi di una sola parola. Ogni risposta corretta ti fa guadagnare un punto!"
20
  },
21
- rules: {
22
- title: "Le Regole",
23
- items: [
24
- "Solo una parola per indizio",
25
- "Niente parti della parola segreta o traduzioni",
26
- "Gli indizi devono essere correlati alla parola (sii creativo!)",
27
- "Non si può sillabare la risposta"
28
- ]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
29
  }
30
  },
31
- game: {
32
- buildDescription: "Costruisci una Descrizione",
33
- buildSubtitle: "Alternati con l'IA per descrivere la tua parola senza usare la parola stessa!",
34
- startSentence: "Inizia la tua frase...",
35
- inputPlaceholder: "Inserisci la tua parola (solo lettere)...",
36
- addWord: "Aggiungi Parola",
37
- makeGuess: "Fai Indovinare l'IA",
38
- aiThinking: "L'IA sta pensando...",
39
- aiDelayed: "L'IA è attualmente occupata. Riprova tra un momento.",
40
- invalidWord: "Parola Non Valida",
41
- cantUseTargetWord: "Non puoi usare parole che contengono",
42
- lettersOnly: "Per favore usa solo lettere (no numeri o caratteri speciali)"
43
- },
44
  guess: {
45
- title: "Tentativo dell'IA",
46
  sentence: "La tua frase",
47
  aiGuessed: "L'IA ha indovinato",
48
- correct: "Indovinato correttamente! 🎉 Pronto per il prossimo round? Premi Invio",
49
- incorrect: "Game Over! Premi Invio per giocare di nuovo",
50
- nextRound: "Prossimo Round",
 
 
 
51
  playAgain: "Gioca Ancora",
52
  viewLeaderboard: "Vedi Classifica"
53
  },
54
- gameOver: {
55
- title: "Game Over!",
56
- completedRounds: "Hai completato {count} round con successo!",
57
- playAgain: "Gioca Ancora"
58
- },
59
  themes: {
60
  title: "Scegli un Tema",
61
- subtitle: "Seleziona un tema per la tua avventura di indovinelli",
62
- standard: "",
63
  technology: "Tecnologia",
64
  sports: "Sport",
65
  food: "Cibo",
66
- custom: "Scegli il tuo tema",
67
- customPlaceholder: "Inserisci un tema (es: Animali, Film)",
68
  continue: "Continua",
69
- generating: "Generazione parole tematiche...",
70
  pressKey: "Premi"
71
  },
72
- leaderboard: {
73
- title: "Classifica",
74
- yourScore: "Il tuo punteggio",
75
- roundCount: "round",
76
- wordsPerRound: "parole/round",
77
- enterName: "Inserisci il tuo nome (solo lettere e numeri)",
78
- submit: "Invia Punteggio",
79
- submitting: "Invio in corso...",
80
- rank: "Posizione",
81
- player: "Giocatore",
82
- roundsColumn: "Round",
83
- avgWords: "Media Parole/Round",
84
- noScores: "Ancora nessun punteggio. Sii il primo!",
85
- previous: "Precedente",
86
- next: "Successivo",
87
- error: {
88
- invalidName: "Inserisci un nome valido (solo lettere e numeri)",
89
- noRounds: "Devi completare almeno un round per inviare un punteggio",
90
- alreadySubmitted: "Hai già inviato il tuo punteggio per questa partita",
91
- newHighScore: "Nuovo Record!",
92
- beatRecord: "Hai battuto il tuo record precedente di {score} round!",
93
- notHigher: "Il tuo punteggio attuale ({current}) non è superiore al miglior punteggio ({best})",
94
- submitError: "Errore nell'invio del punteggio. Riprova."
 
 
 
 
95
  }
96
  }
97
  };
 
1
  export const it = {
2
+ game: {
3
+ round: "Turno",
4
+ buildDescription: "Costruite una frase insieme",
5
+ buildSubtitle: "Aggiungete parole a turno per creare una frase",
6
+ startSentence: "Inizia a costruire la tua frase...",
7
+ inputPlaceholder: "Inserisci una parola...",
8
+ addWord: "Aggiungi parola",
9
+ makeGuess: "Indovina",
10
+ aiThinking: "L'IA sta pensando...",
11
+ aiDelayed: "L'IA è attualmente occupata. Riprova tra un momento.",
12
+ invalidWord: "Parola non valida",
13
+ cantUseTargetWord: "Non puoi usare la parola obiettivo",
14
+ lettersOnly: "Usa solo lettere",
15
+ leaveGameTitle: "Lasciare il gioco?",
16
+ leaveGameDescription: "I tuoi progressi attuali andranno persi. Sei sicuro di voler uscire?",
17
+ cancel: "Annulla",
18
+ confirm: "Conferma",
19
+ describeWord: "Il tuo obiettivo è descrivere la parola"
20
  },
21
+ leaderboard: {
22
+ title: "Punteggi Migliori",
23
+ yourScore: "Il Tuo Punteggio",
24
+ roundCount: "turni",
25
+ wordsPerRound: "parole per turno",
26
+ enterName: "Inserisci il tuo nome",
27
+ submitting: "Invio in corso...",
28
+ submit: "Invia Punteggio",
29
+ rank: "Posizione",
30
+ player: "Giocatore",
31
+ roundsColumn: "Turni",
32
+ avgWords: "Media Parole",
33
+ noScores: "Ancora nessun punteggio",
34
+ previous: "Precedente",
35
+ next: "Successivo",
36
+ error: {
37
+ invalidName: "Inserisci un nome valido",
38
+ noRounds: "Devi completare almeno un turno",
39
+ alreadySubmitted: "Punteggio già inviato",
40
+ newHighScore: "Nuovo Record!",
41
+ beatRecord: "Hai battuto il tuo record precedente di {score}!",
42
+ notHigher: "Punteggio di {current} non superiore al tuo migliore di {best}",
43
+ submitError: "Errore nell'invio del punteggio"
44
  }
45
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
46
  guess: {
47
+ title: "Ipotesi dell'IA",
48
  sentence: "La tua frase",
49
  aiGuessed: "L'IA ha indovinato",
50
+ goalDescription: "Il tuo obiettivo era descrivere la parola",
51
+ providedDescription: "Hai fornito la descrizione",
52
+ aiGuessedDescription: "Basandosi sulla tua descrizione, l'IA ha indovinato",
53
+ correct: "Corretto! L'IA ha indovinato la parola!",
54
+ incorrect: "Sbagliato. Riprova!",
55
+ nextRound: "Prossimo Turno",
56
  playAgain: "Gioca Ancora",
57
  viewLeaderboard: "Vedi Classifica"
58
  },
 
 
 
 
 
59
  themes: {
60
  title: "Scegli un Tema",
61
+ subtitle: "Seleziona un tema per la parola che l'IA cercherà di indovinare",
62
+ standard: "Standard",
63
  technology: "Tecnologia",
64
  sports: "Sport",
65
  food: "Cibo",
66
+ custom: "Tema Personalizzato",
67
+ customPlaceholder: "Inserisci il tuo tema personalizzato...",
68
  continue: "Continua",
69
+ generating: "Generazione...",
70
  pressKey: "Premi"
71
  },
72
+ welcome: {
73
+ title: "Think in Sync",
74
+ subtitle: "Costruisci frasi insieme e lascia che l'IA indovini la tua parola!",
75
+ startButton: "Inizia Gioco",
76
+ howToPlay: "Come Giocare",
77
+ leaderboard: "Classifica",
78
+ credits: "Creato durante il",
79
+ helpWin: "Aiutaci a vincere",
80
+ onHuggingface: "Mettendo una stella su Huggingface"
81
+ },
82
+ howToPlay: {
83
+ setup: {
84
+ title: "Preparazione",
85
+ description: "Scegli un tema e ottieni una parola segreta che l'IA cercherà di indovinare."
86
+ },
87
+ goal: {
88
+ title: "Obiettivo",
89
+ description: "Costruisci frasi insieme all'IA che descrivono la tua parola senza usarla direttamente."
90
+ },
91
+ rules: {
92
+ title: "Regole",
93
+ items: [
94
+ "Aggiungi parole a turno per costruire frasi descrittive",
95
+ "Non usare la parola segreta o le sue variazioni",
96
+ "Sii creativo e descrittivo",
97
+ "L'IA cercherà di indovinare la tua parola dopo ogni frase"
98
+ ]
99
  }
100
  }
101
  };
supabase/functions/generate-word/index.ts CHANGED
@@ -10,17 +10,17 @@ const languagePrompts = {
10
  en: {
11
  systemPrompt: "You are helping in a word game. The secret word is",
12
  task: "Your task is to find a sentence to describe this word without using it directly.",
13
- instruction: "Answer with a complete, grammatically correct sentence that starts with"
14
  },
15
  fr: {
16
  systemPrompt: "Vous aidez dans un jeu de mots. Le mot secret est",
17
  task: "Votre tâche est de trouver une phrase pour décrire ce mot sans l'utiliser directement.",
18
- instruction: "Répondez avec une phrase complète et grammaticalement correcte qui commence par"
19
  },
20
  de: {
21
  systemPrompt: "Sie helfen bei einem Wortspiel. Das geheime Wort ist",
22
- task: "Ihre Aufgabe ist es, einen Satz zu finden, der dieses Wort beschreibt, ohne es direkt zu verwenden.",
23
- instruction: "Antworten Sie mit einem vollständigen, grammatikalisch korrekten Satz, der beginnt mit"
24
  },
25
  it: {
26
  systemPrompt: "Stai aiutando in un gioco di parole. La parola segreta è",
 
10
  en: {
11
  systemPrompt: "You are helping in a word game. The secret word is",
12
  task: "Your task is to find a sentence to describe this word without using it directly.",
13
+ instruction: "Answer with a description for this word. Start your answer with"
14
  },
15
  fr: {
16
  systemPrompt: "Vous aidez dans un jeu de mots. Le mot secret est",
17
  task: "Votre tâche est de trouver une phrase pour décrire ce mot sans l'utiliser directement.",
18
+ instruction: "Répondez avec une phrase qui commence par"
19
  },
20
  de: {
21
  systemPrompt: "Sie helfen bei einem Wortspiel. Das geheime Wort ist",
22
+ task: "Ihre Aufgabe ist es, eine Beschreibung zu finden, der dieses Wort beschreibt, ohne es direkt zu verwenden.",
23
+ instruction: "Beginnen sie ihre Antwort mit"
24
  },
25
  it: {
26
  systemPrompt: "Stai aiutando in un gioco di parole. La parola segreta è",