{
name="tak_nie"
:value="value.toString()"
class="btn btn-primary btn-xl"
- :aria-label="element"
+ :aria-label="$t(element).toLocaleUpperCase()"
:class="
phase == 'exam'
? answer == null
diff --git a/i18n/locales/de.json b/i18n/locales/de.json
index ca3d723..cd980a0 100644
--- a/i18n/locales/de.json
+++ b/i18n/locales/de.json
@@ -12,6 +12,12 @@
"B": "B",
"C": "C"
},
+ "yes": "Tak",
+ "no": "Nie",
+ "theme": "Motyw",
+ "light": "Jasny",
+ "dark": "Ciemny",
+ "auto": "Automatyczny",
"endExam": "Zakończ egzamin",
"examEnd": "Koniec egzaminu",
"basicQuestions": "Pytania podstawowe",
diff --git a/i18n/locales/en.json b/i18n/locales/en.json
index ca3d723..0efca38 100644
--- a/i18n/locales/en.json
+++ b/i18n/locales/en.json
@@ -1,73 +1,79 @@
{
- "mainTitle": "Test na prawo jazdy",
- "loading": "Ładowanie",
- "keybinds": "Skróty klawiszowe",
+ "mainTitle": "Driving exam",
+ "loading": "Loading",
+ "keybinds": "Keybinds",
"bindedKeys": {
- "S": "niebieski przycisk start",
- "D": "następne pytanie",
- "X": "zakończ egzamin",
- "T / Y": "Tak",
- "N": "Nie",
+ "S": "blue \"start\" button",
+ "D": "next question",
+ "X": "finish exam",
+ "T / Y": "Yes",
+ "N": "No",
"A": "A",
"B": "B",
"C": "C"
},
- "endExam": "Zakończ egzamin",
- "examEnd": "Koniec egzaminu",
- "basicQuestions": "Pytania podstawowe",
- "advancedQuestions": "Pytania specjalistyczne",
- "timeToGetAcquaintedWithTheQuestion": "Czas na zapoznanie się z pytaniem",
- "timeForAnswer": "Czas na udzielenie odpowiedzi",
+ "yes": "Yes",
+ "no": "No",
+ "theme": "Theme",
+ "light": "Light",
+ "dark": "Dark",
+ "auto": "Auto",
+ "endExam": "Finish exam",
+ "examEnd": "Exam finished",
+ "basicQuestions": "Basic questions",
+ "advancedQuestions": "Advanced questions",
+ "timeToGetAcquaintedWithTheQuestion": "Time to get acquainted with the question",
+ "timeForAnswer": "Time to answer",
"startBtn": "START",
"second": "s",
- "nextQuestion": "Następne pytanie",
- "goBackToHomePage": "Wróć na stronę główną",
- "points": "Punkty",
- "pointValue": "Wartość punktowa",
- "currentCategory": "Aktualna kategoria",
- "timeToExamEnd": "Czas do końca egzaminu",
- "result": "Wynik",
- "startAgain": "Rozpocznij jeszcze raz",
- "viewAnswers": "Przejrzyj odpowiedzi",
- "doYouReallyWantToEndExam": "Czy na pewno chcesz zakończyć egzamin?",
- "questionWithoutVisual": "Pytanie bez wizualizacji",
- "categoryWord": "Kategoria",
- "anAnomalyHasOccured": "Nastąpiła anomalia",
- "redirectFrom": "Przekierowanie z",
- "end": "Koniec",
- "question": "Pytanie",
- "anAPIErrorOccured": "Wystąpił błąd z API",
- "positive": "pozytywny",
- "negative": "negatywny",
- "theoreticalExam": "Egzamin teorytyczny",
+ "nextQuestion": "Next question",
+ "goBackToHomePage": "Back to homepage",
+ "points": "Points",
+ "pointValue": "Point value",
+ "currentCategory": "Current category",
+ "timeToExamEnd": "Time until the exam's finished",
+ "result": "Result",
+ "startAgain": "Start again",
+ "viewAnswers": "View answers",
+ "doYouReallyWantToEndExam": "Are you sure you want to finish the exam?",
+ "questionWithoutVisual": "Question without visualization",
+ "categoryWord": "Category",
+ "anAnomalyHasOccured": "An anomaly has occured",
+ "redirectFrom": "Redirecting from",
+ "end": "End",
+ "question": "Question",
+ "anAPIErrorOccured": "An API error has occured",
+ "positive": "positive",
+ "negative": "negative",
+ "theoreticalExam": "Theoretical exam",
"category": {
"description": {
- "A": "motocykle bez ograniczeń mocy",
- "B": "⭐ samochody osobowe do 3,5 t",
- "C": "pojazdy ciężarowe powyżej 3,5 t",
- "D": "autobusy",
- "T": "ciągniki rolnicze i pojazdy wolnobieżne",
- "AM": "motorowery i lekkie czterokołowce",
- "A1": "motocykle do 125 cm³ i 11 kW",
- "A2": "motocykle do 35 kW",
- "B1": "czterokołowce (np. quady)",
- "C1": "pojazdy od 3,5 t do 7,5 t",
- "D1": "autobusy do 16 pasażerów",
- "PT": "tramwaje"
+ "A": "motorcycle without limited power",
+ "B": "⭐ passenger cars up to 3,5 t",
+ "C": "trucks above 3,5 t",
+ "D": "buses",
+ "T": "agricultural tractor and low-speed vehicles",
+ "AM": "motobikes and light quadricycles",
+ "A1": "motorcycles up to 125 cm³ and 11 kW",
+ "A2": "motorcycles up to 35 kW",
+ "B1": "quadricycles (e.g quads)",
+ "C1": "vehicles from 3,5 t to 7,5 t",
+ "D1": "buses up to 16 passengers",
+ "PT": "trams"
},
"age": {
- "A": "(24 lata; lub 20 lat jeśli masz kat. A2 min. 2 lata)",
- "B": "(18 lat)",
- "C": "(21 lat; lub 18 lat z kwalifikacją wstępną)",
- "D": "(24 lata; lub 21 lat z kwalifikacją wstępną)",
- "T": "(16 lat)",
- "AM": "(14 lat)",
- "A1": "(16 lat)",
- "A2": "(18 lat)",
- "B1": "(16 lat)",
- "C1": "(18 lat)",
- "D1": "(21 lat; lub 18 lat z kwalifikacją wstępną)",
- "PT": "(21 lat)"
+ "A": "(24 years; or 20 years if you've had category A2 for at least 2 years)",
+ "B": "(18 years)",
+ "C": "(21 years; or 18 years with preliminary qualification)",
+ "D": "(24 years; or 21 years with preliminary qualification)",
+ "T": "(16 years)",
+ "AM": "(14 years)",
+ "A1": "(16 years)",
+ "A2": "(18 years)",
+ "B1": "(16 years)",
+ "C1": "(18 years)",
+ "D1": "(21 years; or 18 years with preliminary qualification)",
+ "PT": "(21 years)"
}
}
}
diff --git a/i18n/locales/pl.json b/i18n/locales/pl.json
index ca3d723..cd980a0 100644
--- a/i18n/locales/pl.json
+++ b/i18n/locales/pl.json
@@ -12,6 +12,12 @@
"B": "B",
"C": "C"
},
+ "yes": "Tak",
+ "no": "Nie",
+ "theme": "Motyw",
+ "light": "Jasny",
+ "dark": "Ciemny",
+ "auto": "Automatyczny",
"endExam": "Zakończ egzamin",
"examEnd": "Koniec egzaminu",
"basicQuestions": "Pytania podstawowe",
diff --git a/i18n/locales/ua.json b/i18n/locales/ua.json
index ca3d723..cd980a0 100644
--- a/i18n/locales/ua.json
+++ b/i18n/locales/ua.json
@@ -12,6 +12,12 @@
"B": "B",
"C": "C"
},
+ "yes": "Tak",
+ "no": "Nie",
+ "theme": "Motyw",
+ "light": "Jasny",
+ "dark": "Ciemny",
+ "auto": "Automatyczny",
"endExam": "Zakończ egzamin",
"examEnd": "Koniec egzaminu",
"basicQuestions": "Pytania podstawowe",
diff --git a/middleware/exam.ts b/middleware/exam.ts
index 435f86f..f833340 100644
--- a/middleware/exam.ts
+++ b/middleware/exam.ts
@@ -1,9 +1,11 @@
export default defineNuxtRouteMiddleware(async () => {
const examStore = useExamStore();
+ const localePath = useLocalePath();
+
if (examStore.end) {
- return '/result';
+ return localePath('result');
}
if (examStore.category === '') {
- return '/anomaly';
+ return localePath('anomaly');
}
});
diff --git a/middleware/result.ts b/middleware/result.ts
index 4c95f7e..12e74e0 100644
--- a/middleware/result.ts
+++ b/middleware/result.ts
@@ -1,6 +1,7 @@
export default defineNuxtRouteMiddleware(async () => {
const examStore = useExamStore();
+ const localePath = useLocalePath();
if (!examStore.end || examStore.category === '') {
- return '/anomaly';
+ return localePath('anomaly');
}
});
diff --git a/pages/anomaly.vue b/pages/anomaly.vue
index 5aedc05..da9dc2c 100644
--- a/pages/anomaly.vue
+++ b/pages/anomaly.vue
@@ -18,7 +18,7 @@ const advancedStore = useAdvancedStore();
{{ $t('advancedQuestions') }}:
{{ advancedStore.advanced }}
-
+
{{ $t('goBackToHomePage') }}
diff --git a/pages/exam.vue b/pages/exam.vue
index f191038..3c73cc1 100644
--- a/pages/exam.vue
+++ b/pages/exam.vue
@@ -183,6 +183,8 @@ function next() {
}
}
+const localePath = useLocalePath();
+
function endExam() {
loading.value = true;
while (ending.value == false) {
@@ -200,9 +202,9 @@ function endExam() {
advancedStore.advanced == result.value.advanced &&
examStore.end
) {
- return navigateTo(`/result`, { replace: true });
+ return navigateTo(localePath(`result`), { replace: true });
} else {
- return navigateTo(`/anomaly`);
+ return navigateTo(localePath(`anomaly`));
}
}
diff --git a/pages/index.vue b/pages/index.vue
index 2775c9c..4dd85e3 100644
--- a/pages/index.vue
+++ b/pages/index.vue
@@ -15,12 +15,14 @@ const loading = ref(false);
const examStore = useExamStore();
await callOnce(() => examStore.resetExam(), { mode: 'navigation' });
+const localePath = useLocalePath();
+
function setAndGo(category: string) {
loading.value = true;
examStore.setCategory(category);
while (true) {
if (examStore.category === category) {
- return navigateTo('/exam');
+ return navigateTo(localePath('exam'));
}
}
}
@@ -31,6 +33,27 @@ function changeLanguage() {
examStore.setLang(langSelect.value);
setLocale(langSelect.value as 'pl' | 'en' | 'de' | 'ua');
}
+
+const dark = ref(false);
+
+function getTheme() {
+ if (
+ window.matchMedia &&
+ window.matchMedia('(prefers-color-scheme: dark)').matches
+ ) {
+ dark.value = true;
+ } else {
+ dark.value = false;
+ }
+}
+
+watchEffect(getTheme);
+
+const themeStore = useThemeStore();
+
+function themeAuto() {
+ themeStore.set('');
+}
@@ -50,8 +73,24 @@ function changeLanguage() {
+