From b079f72c2325953a3796c54a428c582387ab45f4 Mon Sep 17 00:00:00 2001 From: Mawoka Date: Wed, 19 Apr 2023 18:37:46 +0200 Subject: [PATCH] :globe_with_meridians: Added some missing translations --- frontend/src/lib/admin.svelte | 14 ++-- frontend/src/lib/editor.svelte | 7 +- frontend/src/lib/editor/ABCDEditorPart.svelte | 2 +- .../src/lib/editor/OrderEditorPart.svelte | 2 +- frontend/src/lib/editor/TextEditorPart.svelte | 2 +- .../src/lib/editor/VotingEditorPart.svelte | 2 +- frontend/src/lib/editor/card.svelte | 6 ++ frontend/src/lib/editor/settings-card.svelte | 2 +- frontend/src/lib/editor/sidebar.svelte | 24 +++--- .../editor/slides/element_selection.svelte | 14 ++-- frontend/src/lib/i18n/locales/de.json | 14 +++- frontend/src/lib/i18n/locales/en.json | 74 +++++++++++++++++-- frontend/src/lib/navbar.svelte | 4 +- .../src/lib/play/admin/final_results.svelte | 12 ++- .../lib/play/admin/game_not_started.svelte | 7 +- frontend/src/lib/play/admin/results.svelte | 10 ++- frontend/src/routes/+page.svelte | 2 +- .../src/routes/account/settings/+page.svelte | 10 ++- .../account/settings/avatar/+page.svelte | 8 +- .../account/settings/security/+page.svelte | 39 ++++++---- .../settings/security/backup_codes.svelte | 14 ++-- .../settings/security/totp_setup.svelte | 17 +++-- .../[result_id]/general_overview.svelte | 13 +++- .../[result_id]/player_overview.svelte | 2 +- .../src/routes/user/[user_id]/+page.svelte | 8 +- .../src/routes/view/[quiz_id]/+page.svelte | 5 +- 26 files changed, 221 insertions(+), 93 deletions(-) diff --git a/frontend/src/lib/admin.svelte b/frontend/src/lib/admin.svelte index 2e20172..bf9b79b 100644 --- a/frontend/src/lib/admin.svelte +++ b/frontend/src/lib/admin.svelte @@ -132,7 +132,7 @@ {#if selected_question + 1 === quiz_data.questions.length && ((timer_res === '0' && question_results !== null) || quiz_data?.questions?.[selected_question]?.type === QuizQuestionType.SLIDE)} {#if JSON.stringify(final_results) === JSON.stringify([null])} {/if} {:else if timer_res === '0' || selected_question === -1} @@ -142,7 +142,7 @@ set_question_number(selected_question + 1); }} class="admin-button" - >Next Question ({selected_question + 2}) + >{$t('admin_page.next_question', { question: selected_question + 2 })} {/if} {#if question_results === null && selected_question !== -1} @@ -152,11 +152,11 @@ set_question_number(selected_question + 1); }} class="admin-button" - >Next Question ({selected_question + 2}) + >{$t('admin_page.next_question', { question: selected_question + 2 })} {:else} {/if} {/if} @@ -167,11 +167,11 @@ set_question_number(selected_question + 1); }} class="admin-button" - >Next Question ({selected_question + 2}) + >{$t('admin_page.next_question', { question: selected_question + 2 })} {:else} {/if} {:else} @@ -262,7 +262,7 @@ {:else}
-

Enter your answer into the input field!

+

{$t('admin_page.enter_answer_into_field')}

{/if} {/if} diff --git a/frontend/src/lib/editor.svelte b/frontend/src/lib/editor.svelte index a298ebd..3d7da29 100644 --- a/frontend/src/lib/editor.svelte +++ b/frontend/src/lib/editor.svelte @@ -11,6 +11,9 @@ import SettingsCard from '$lib/editor/settings-card.svelte'; import QuizCard from '$lib/editor/card.svelte'; import Spinner from './Spinner.svelte'; + import { getLocalization } from '$lib/i18n'; + + const { t } = getLocalization(); let schemaInvalid = false; let yupErrorMessage = ''; @@ -152,10 +155,10 @@

{/if} @@ -190,7 +192,7 @@ class:dark:text-black={index === selected_question} > {#if question.question === ''} - No title... + {$t('editor.no_title')} {:else} {@html question.question} {/if} @@ -222,10 +224,11 @@ 'answer' ).isValidSync(answer.answer)} use:tippy={{ - content: answer.answer === '' ? 'Empty...' : answer.answer + content: + answer.answer === '' ? $t('editor.empty') : answer.answer }} >{#if answer.answer === ''} - Empty... + {$t('editor.empty')} {:else} {answer.answer} {/if}{#if answer.answer === ''} - Empty... + {$t('editor.empty')} {:else} {answer.answer} {/if} - Question + {$t('words.question')} - Slide + {$t('words.slide')} = [ { - name: 'Headline', - description: 'A bold text for headlines', + name: $t('editor.slide.headline'), + description: $t('editor.slide.headline_description'), type: ElementTypes.Headline, icon: undefined, shortcut: 'h' }, { - name: 'Text', - description: 'Smaller longer text', + name: $t('editor.slide.text'), + description: $t('editor.slide.text_description'), type: ElementTypes.Text, icon: undefined, shortcut: 't' }, { - name: 'Rectangle', - description: 'Just a rectangle', + name: $t('editor.slide.rectangle'), + description: $t('editor.slide.rectangle_description'), type: ElementTypes.Rectangle, icon: undefined, shortcut: 'r' diff --git a/frontend/src/lib/i18n/locales/de.json b/frontend/src/lib/i18n/locales/de.json index 61c51f8..368a6c9 100644 --- a/frontend/src/lib/i18n/locales/de.json +++ b/frontend/src/lib/i18n/locales/de.json @@ -48,7 +48,8 @@ "community_driven_content": "ClassQuiz hängt von der Community ab, die ClassQuiz mit Spenden, Feature-Requests, Übersetzungen und mehr versorgt! Du kannst auch ein Teil der ClassQuiz-Community werden!", "download_quizzes_content": "Quiz können als einzige Datei heruntergeladen werden und jederzeit importiert werden, sodass du auch einfach auf eine andere Instanz von ClassQuiz umziehen kannst!", "community_driven": "Von der Community betrieben", - "download_quizzes": "Quiz herunterladen" + "download_quizzes": "Quiz herunterladen", + "how_does_classquiz_work": "Wie funktioniert ClassQuiz überhaupt?" }, "overview_page": { "created_at": "Erstellt am", @@ -161,7 +162,8 @@ "score": "Punkte", "results": "Ergebnisse", "note": "Notiz", - "player_plural": "Spieler" + "player_plural": "Spieler", + "slide": "Folie" }, "editor": { "time_in_seconds": "Zeit in Sekunden", @@ -170,7 +172,10 @@ "add_new_question": "Neue Frage hinzufügen", "delete_question": "Frage löschen", "delete_answer": "Antwort löschen", - "not_all_links_imgur_links": "Nicht alle Links sind Imgur-Links!" + "not_all_links_imgur_links": "Nicht alle Links sind Imgur-Links!", + "no_title": "Kein Titel...", + "empty": "Leer...", + "bg_image": "Hintergrundbild" }, "import": { "need_help": "", @@ -279,5 +284,8 @@ "time_taken": "benötigte Zeit", "player_name": "Spielername", "correct_answer_plural": "{{count}} richtige Antworten" + }, + "navbar": { + "donate": "Spenden" } } diff --git a/frontend/src/lib/i18n/locales/en.json b/frontend/src/lib/i18n/locales/en.json index c6ee4d3..f6d8409 100644 --- a/frontend/src/lib/i18n/locales/en.json +++ b/frontend/src/lib/i18n/locales/en.json @@ -48,7 +48,8 @@ "download_quizzes": "Download Quizzes", "download_quizzes_content": "Quizzes can be downloaded as one file and imported at any time. This also lets you move your quizzes to other ClassQuiz instances.", "community_driven": "Community-driven", - "community_driven_content": "ClassQuiz depends on its community for funding, testing ideas, feature requests, translations and more! You can also be a part of the ClassQuiz-community!" + "community_driven_content": "ClassQuiz depends on its community for funding, testing ideas, feature requests, translations and more! You can also be a part of the ClassQuiz-community!", + "how_does_classquiz_work": "How does ClassQuiz even work?" }, "overview_page": { "created_at": "Created at", @@ -161,7 +162,13 @@ "results": "Results", "note": "Note", "player_plural": "Players", - "score": "Score" + "score": "Score", + "slide": "Slide", + "name": "Name", + "point": "Point", + "point_plural": "Points", + "back": "Back", + "finish": "Finish" }, "editor": { "time_in_seconds": "Time in seconds", @@ -170,7 +177,18 @@ "add_new_question": "Add new question", "delete_question": "Delete question", "delete_answer": "Delete answer", - "not_all_links_imgur_links": "Not all links are Imgur-links!" + "not_all_links_imgur_links": "Not all links are Imgur-links!", + "no_title": "No title...", + "empty": "Empty...", + "bg_image": "Background image", + "slide": { + "headline": "Headline", + "headline_description": "A bold text for headlines", + "text": "Text", + "text_description": "Smaller longer text", + "rectangle": "Rectangle", + "rectangle_description": "Just a rectangle" + } }, "import_page": { "need_help": "Need help?", @@ -194,7 +212,11 @@ "start_by_showing_first_question": "Start by showing the first question.", "no_answers": "No answers!", "stop_time": "Stop time", - "save_results": "Save results" + "save_results": "Save results", + "next_question": "Next Question ({{question}})", + "show_results": "Show results", + "stop_time_and_solutions": "Stop time and show solutions", + "enter_answer_into_field": "Enter your answer into the input field!" }, "password_reset_page": { "reset_password": "Reset password" @@ -207,7 +229,9 @@ "last_seen": "Last seen", "check_location": "Check location", "delete_this_session": "Delete this session", - "this_session?": "This session?" + "this_session?": "This session?", + "change_avatar": "Change avatar", + "security_settings": "Security-Settings" }, "explore_page": { "made_by": "Made by", @@ -222,7 +246,12 @@ "1st_place": "1st Place", "2nd_place": "2nd Place", "3rd place": "3rd Place", - "with_out_of": "with {{correct_questions}} out of {{total_question_count}}" + "with_out_of": "with {{correct_questions}} out of {{total_question_count}}", + "final_result_rank": "{{place}}: {{username}} with {{points}} points", + "your_score": "Your score: {{score}}", + "join_description": "Join at {{url}} and enter {{pin}}.", + "join_by_entering_code": "Join by entering the following code", + "points_added": "Points added" }, "editor_page": { "add_an_answer": "Add an answer", @@ -257,7 +286,8 @@ "clothe_color": "Clothing color", "clothe_graphic_type": "Graphic", "thats_you": "That's You!", - "start_over": "Start over" + "start_over": "Start over", + "go_back": "Go back" }, "results_page": { "no_results_so_far": "No results saved so far...", @@ -272,5 +302,35 @@ "correct_answer": "{{count}} correct answer", "correct_answer_plural": "{{count}} correct answers", "time_taken": "Time taken" + }, + "navbar": { + "donate": "Donate" + }, + "security_settings": { + "backup_code": "Backup-Code", + "get_backup_code": "Get Backup-Code", + "activate_2fa": "Activate Two Factor Authentication", + "2fa_activated": "Two Factor authentication is activated", + "2fa_deactivated": "Two Factor authentication is deactivated", + "webauthn": "Webauthn", + "webauthn_available": "Webauthn is available", + "webauthn_unavailable": "Webauthn is not available", + "add_security_key": "Add Security-Key", + "totp": "Totp", + "totp_available": "Totp is available", + "totp_unavailable": "Totp is not available", + "disable_totp": "Disable Totp", + "enable_totp": "Enable Totp", + "backup_codes": { + "your_backup_code": "Your Backup-Code", + "save_somewhere_save": "Save this somewhere safe!", + "download_code": "Download code" + }, + "totp_setup": { + "scan_to_set_up": "Scan this QR-code to set up the code", + "enter_as_secret_if_no_see_code": "Enter this as the secret if you can't scan the QR-code", + "totp_setup": "Totp-Setup", + "do_not_forget_backup_code": "Do not forget to save your recovery-code!" + } } } diff --git a/frontend/src/lib/navbar.svelte b/frontend/src/lib/navbar.svelte index 7e2f403..599b136 100644 --- a/frontend/src/lib/navbar.svelte +++ b/frontend/src/lib/navbar.svelte @@ -109,7 +109,7 @@