🌐 Added strings to translate

This commit is contained in:
Mawoka
2022-03-26 20:38:19 +01:00
parent 7f44911c6e
commit dcf5c6e73e
12 changed files with 176 additions and 107 deletions
+15 -11
View File
@@ -1,4 +1,8 @@
<script lang="ts">
import { getLocalization } from '$lib/i18n';
const { t } = getLocalization();
interface Data {
public: boolean;
title: string;
@@ -51,37 +55,37 @@
</label>
{#each data.questions as question, index_question}
<div class="ml-8 grid grid-cols-1 gap-2 m-2 border border-black border-2">
<h1 class="text-3xl">Question {index_question + 1}</h1>
<h1 class="text-3xl">{$t('words.question')} {index_question + 1}</h1>
<label>
<input
type="text"
placeholder="Question"
placeholder={$t('words.question')}
bind:value={question.question}
class="text-black"
/>
Question
{$t('words.question')}
</label>
<label>
<input type="text" placeholder="20" bind:value={question.time} class="text-black" />
Time in seconds
{$t('editor.time_in_seconds')}
</label>
{#each question.answers as answer, index_answer}
<div class="ml-8 grid grid-cols-1 gap-2 m-2 border border-black border-2">
<h1 class="text-3xl">Answer {index_answer + 1}</h1>
<p>Answer: {index_answer} Question: {index_question}</p>
<h1 class="text-3xl">{$t('words.answer')} {index_answer + 1}</h1>
<p>{$t('words.answer')}: {index_answer} {$t('words.question')}: {index_question}</p>
<label>
<input
type="text"
placeholder="Answer"
placeholder={$t('words.answer')}
bind:value={data.questions[index_question].answers[index_answer].answer}
class="text-black"
/>
Answer
{$t('words.answer')}
</label>
<label>
<input type="checkbox" bind:checked={answer.right} class="text-black" />
Right?
{$t('editor.right_or_true?')}?
</label>
<button
class="text-left"
@@ -93,7 +97,7 @@
];
}}
>
Add new answer
{$t('editor.add_new_answer')}
</button>
</div>
{/each}
@@ -104,7 +108,7 @@
data.questions = [...data.questions, { ...empty_question }];
}}
>
Add new question
{$t('editor.add_new_question')}
</button>
</div>
{/each}
+52 -23
View File
@@ -4,8 +4,6 @@
"title": "Home",
"description": "ClassQuiz ist eine Quiz-App wie KAHOOT! für Schüler*innen, welche open-source und kostenlos ist"
},
"stats": "Statistiken",
"features": "Features",
"features_description": {
"1": "ClassQuiz ist eine Quiz-Platform, welche das erstellen und managen von Quizzes erlaubt.",
"2": "Das Hauptfeature ist die KAHOOT!-Importfunktion, mit der man Quizzes von KAHOOT! importieren kann."
@@ -13,41 +11,24 @@
"slogan": "Die open-source Quiz-Platform!"
},
"overview_page": {
"create": "Erstellen",
"import": "Importieren",
"logout": "Ausloggen",
"title": "Titel",
"created_at": "Erstellt am",
"question_count": "Fragenanzahl",
"play": "Spielen",
"edit": "Bearbeiten",
"delete": "Löschen",
"public": "Öffentlich",
"start": "Starten"
"question_count": "Fragenanzahl"
},
"edit_page": {
"save": "Speichern",
"success_update_title": "Quiz erfolgreich aktualisiert!",
"success_update_body": "Das Quiz wurde erfolgreich aktualisiert!",
"close": "Schließen"
"success_update_body": "Das Quiz wurde erfolgreich aktualisiert!"
},
"create_page": {
"success": {
"title": "Quiz erfolgreich erstellt!",
"body": "Das Quiz wurde erfolgreich erstellt!"
},
"close": "Schließen"
}
},
"register_page": {
"greeting": "Schön, dich zu sehen!",
"create_account": "Account erstellen",
"email": "Email",
"username": "Nutzername",
"password": "Passwort",
"forgot_password?": "Passwort vergessen?",
"register": "Registrieren",
"already_have_account?": "Hast du schon einen Account?",
"login": "Login"
"already_have_account?": "Hast du schon einen Account?"
},
"login_page": {
"welcome_back": "Willkommen zurück!",
@@ -71,5 +52,53 @@
}
}
}
},
"words": {
"question": "",
"answer": "",
"stats": "",
"features": "",
"import": "",
"url": "",
"submit": "",
"create": "",
"logout": "",
"title": "",
"play": "",
"edit": "",
"delete": "",
"public": "",
"start": "",
"connect": "",
"pin": "",
"kick": "",
"register": "",
"login": "",
"docs": "",
"close": "",
"save": ""
},
"editor": {
"time_in_seconds": "",
"right_or_true?": "",
"add_new_answer": "",
"add_new_question": ""
},
"import": {
"need_help": "",
"visit_docs": ""
},
"admin": {
"already_registered_as_admin": ""
},
"admin_page": {
"already_registered_as_admin": "",
"start_game": "",
"time_left": "",
"get_results": ""
},
"import_page": {
"need_help": "",
"visit_docs": ""
}
}
+48 -23
View File
@@ -5,49 +5,30 @@
"description": "ClassQuiz is a quiz app like KAHOOT! for students, which is open source and free to use",
"title": "Home"
},
"stats": "Stats",
"features": "Features",
"features_description": {
"1": "ClassQuiz is a quiz-platform that allows you to create and manage quizzes.",
"2": "The main feature is a KAHOOT!-import function that allows you to import quizzes from KAHOOT!-quizzes."
}
},
"overview_page": {
"create": "Create",
"import": "Import",
"logout": "Logout",
"title": "Title",
"created_at": "Created at",
"question_count": "Question count",
"play": "Play",
"edit": "Edit",
"delete": "Delete",
"public": "Public",
"start": "Start"
"question_count": "Question count"
},
"edit_page": {
"save": "Save",
"success_update_title": "Successfully updated quiz!",
"success_update_body": "Updated the quiz successfully!",
"close": "Close"
"success_update_body": "Updated the quiz successfully!"
},
"create_page": {
"success": {
"title": "Successfully created quiz!",
"body": "Created the quiz successfully!"
},
"close": "Close"
}
},
"register_page": {
"greeting": "Nice to meet you!",
"create_account": "Create account",
"email": "Email",
"username": "Username",
"password": "Password",
"forgot_password?": "Forgot password?",
"register": "Register",
"already_have_account?": "Already have an account?",
"login": "Login"
"already_have_account?": "Already have an account?"
},
"login_page": {
"welcome_back": "Welcome back!",
@@ -71,5 +52,49 @@
}
}
}
},
"words": {
"question": "Question",
"answer": "Answer",
"stats": "Stats",
"features": "Features",
"login": "Login",
"email": "Email",
"username": "Username",
"password": "Password",
"play": "Play",
"edit": "Edit",
"delete": "Delete",
"public": "Public",
"start": "Start",
"create": "Create",
"import": "Import",
"logout": "Logout",
"title": "Title",
"url": "URL",
"submit": "Submit",
"connect": "Connect",
"pin": "PIN",
"kick": "Kick",
"register": "Register",
"docs": "Docs",
"close": "Close",
"save": "Save"
},
"editor": {
"time_in_seconds": "Time in seconds",
"right_or_true?": "Right?",
"add_new_answer": "Add new answer",
"add_new_question": "Add new question"
},
"import_page": {
"need_help": "Need help?",
"visit_docs": "Visit the documentation"
},
"admin_page": {
"already_registered_as_admin": "There is already an admin registered for this game.",
"start_game": "Start game",
"time_left": "Time left",
"get_results": "Get results"
}
}
+7 -4
View File
@@ -1,5 +1,8 @@
<script>
import '@fontsource/marck-script/index.css';
import { getLocalization } from '$lib/i18n';
const { t } = getLocalization();
let openMenu = true;
let closeMenu = false;
@@ -82,19 +85,19 @@
<li class="py-2">
<a
class="text-lg font-medium lg:px-4 text-gray-600 hover:text-green-600 link-hover"
href="/play">Play</a
href="/play">{$t('words.play')}</a
>
</li>
<li class="py-2">
<a
class="text-lg font-medium lg:px-4 text-gray-600 hover:text-green-600 link-hover"
href="/account/register">Register</a
href="/account/register">{$t('words.register')}</a
>
</li>
<li class="py-2">
<a
class="text-lg font-medium lg:px-4 text-gray-600 hover:text-green-600 link-hover"
href="/account/login">Login</a
href="/account/login">{$t('words.login')}</a
>
</li>
<li class="py-2">
@@ -106,7 +109,7 @@
<li class="py-2">
<a
class="text-lg font-medium lg:px-4 text-gray-600 hover:text-green-600 link-hover"
href="/docs">Docs</a
href="/docs">{$t('words.docs')}</a
>
</li>
</ul>