Skip to content

Commit 8953f4d

Browse files
Merge pull request #127 from DevLoversTeam/localize-main-pages
fix: correct login redirect and improve i18n UX in quiz flow
2 parents 75a8c61 + 5cf2182 commit 8953f4d

5 files changed

Lines changed: 23 additions & 17 deletions

File tree

frontend/components/quiz/CountdownTimer.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,15 @@ export function CountdownTimer({
9999

100100
{percentage <= 30 && (
101101
<p className="text-xs mt-2 font-medium">
102-
{percentage <= 10 ? t('almostDone') : t('hurryUp')}
102+
{percentage <= 10 ? (
103+
<>
104+
<span aria-hidden="true">⚠️</span> {t('almostDone')}
105+
</>
106+
) : (
107+
<>
108+
<span aria-hidden="true"></span> {t('hurryUp')}
109+
</>
110+
)}
103111
</p>
104112
)}
105113
</div>

frontend/components/quiz/QuizResult.tsx

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ export function QuizResult({
109109
{violationsCount >= 3 && (
110110
<div className="p-4 rounded-xl bg-orange-50 dark:bg-orange-900/20 border border-orange-200 dark:border-orange-800">
111111
<p className="text-center text-orange-800 dark:text-orange-200 font-medium">
112-
{t('violations', { count: violationsCount })}
112+
<span aria-hidden="true">⚠️</span> {t('violations', { count: violationsCount })}
113113
</p>
114114
</div>
115115
)}
@@ -140,12 +140,10 @@ export function QuizResult({
140140
<div className="flex flex-col sm:flex-row gap-3 justify-center">
141141
<Button
142142
onClick={() => {
143-
const url = `/${locale}/signup?returnTo=/quiz/${quizSlug}`;
144-
console.log('Navigating to signup:', url);
145-
window.location.href = url;
146-
}}
147-
variant="primary"
148-
>
143+
const url = `/${locale}/login?returnTo=/quiz/${quizSlug}`;
144+
window.location.href = url;
145+
}}
146+
variant="primary">
149147
{t('loginButton')}
150148
</Button>
151149
<Button

frontend/messages/en.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,8 @@
103103
},
104104
"timer": {
105105
"label": "Time remaining:",
106-
"almostDone": "⚠️ Time almost up!",
107-
"hurryUp": "Hurry up!"
106+
"almostDone": "Time is almost up!",
107+
"hurryUp": "Hurry up!"
108108
},
109109
"result": {
110110
"correctAnswers": "correct answers",
@@ -128,7 +128,7 @@
128128
"title": "Excellent Work!",
129129
"message": "You have mastered the material well"
130130
},
131-
"violations": "⚠️ Quiz completed with rule violations ({count} violations). Result not counted towards leaderboard.",
131+
"violations": "Quiz completed with rule violations ({count} violations). Result not counted towards leaderboard.",
132132
"pointsAwarded": "+{points} points added to rating",
133133
"noPointsAwarded": "No points awarded (result not improved)",
134134
"guestMessage": "To save your result and appear on the leaderboard, log in or sign up",

frontend/messages/pl.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,8 @@
103103
},
104104
"timer": {
105105
"label": "Pozostały czas:",
106-
"almostDone": "⚠️ Czas prawie minął!",
107-
"hurryUp": "Pośpiesz się!"
106+
"almostDone": "Czas prawie minął!",
107+
"hurryUp": "Pośpiesz się!"
108108
},
109109
"result": {
110110
"correctAnswers": "prawidłowych odpowiedzi",
@@ -128,7 +128,7 @@
128128
"title": "Doskonała Praca!",
129129
"message": "Dobrze opanowałeś materiał"
130130
},
131-
"violations": "⚠️ Quiz ukończony z naruszeniami zasad ({count} naruszeń). Wynik nie zaliczony do rankingu.",
131+
"violations": "Quiz ukończony z naruszeniami zasad ({count} naruszeń). Wynik nie zaliczony do rankingu.",
132132
"pointsAwarded": "+{points} punktów dodanych do oceny",
133133
"noPointsAwarded": "Nie przyznano punktów (wynik nie poprawiony)",
134134
"guestMessage": "Aby zapisać wynik i pojawić się w rankingu, zaloguj się lub zarejestruj",

frontend/messages/uk.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,8 @@
103103
},
104104
"timer": {
105105
"label": "Залишилось часу:",
106-
"almostDone": "⚠️ Час майже закінчився!",
107-
"hurryUp": "Поспішайте!"
106+
"almostDone": "Час майже закінчився!",
107+
"hurryUp": "Поспішайте!"
108108
},
109109
"result": {
110110
"correctAnswers": "правильних відповідей",
@@ -128,7 +128,7 @@
128128
"title": "Чудова робота!",
129129
"message": "Ви добре засвоїли матеріал"
130130
},
131-
"violations": "⚠️ Квіз завершено з порушеннями правил ({count} порушень). Результат не зараховано до рейтингу.",
131+
"violations": "Квіз завершено з порушеннями правил ({count} порушень). Результат не зараховано до рейтингу.",
132132
"pointsAwarded": "+{points} балів додано до рейтингу",
133133
"noPointsAwarded": "Бали не нараховано (результат не покращено)",
134134
"guestMessage": "Щоб зберегти результат та потрапити в рейтинг, увійдіть або зареєструйтесь",

0 commit comments

Comments
 (0)