feat: multi language support (#254)

* feat: multitranslational support

* - completion of settings page
- completion of sidebar

* sidebar rerendering bug fix

* completion of the lesson navigation & materials page

* completion of the course navigation

* completion of requested languages

* - Implementation of Language Picker
- Rename Bug Fixes

* checkpoint save

* - addition of the language picker to the onboarding.
- addition of the language switcher for the lesson notes.

* merge completion

* initialization of the new branch

* add transition.svelte file

* lesson note bug fix

* feat: add translation migration

* completion of translation

* fix height issue of dropdown

* refactoring

* fix: improve code with LOCALE from db

* finally get it fully functional

* connect with AI

* backward compatibility for lesson note

* preserve old content, when generating AI content

* undo translations in upgrade modal

* fix duplicate key issue from codacy trigger

---------

Co-authored-by: Rotimi Best <best@classroomio.com>
This commit is contained in:
Adeyemi Adetunji
2024-04-19 05:45:48 +01:00
committed by GitHub
co-authored by Rotimi Best
parent ff7d2cee35
commit d75e2f258e
153 changed files with 11264 additions and 1130 deletions
@@ -5,6 +5,7 @@
import Checkbox from '$lib/components/Form/Checkbox.svelte';
import HtmlRender from '$lib/components/HTMLRender/HTMLRender.svelte';
import Grade from '$lib/components/Question/Grade.svelte';
import { t } from '$lib/utils/functions/translations';
export let title = '';
export let index = 1;
@@ -102,7 +103,7 @@
<div class="mt-3 flex items-center justify-between w-full">
<PrimaryButton
onClick={handlePrevious}
label="Previous"
label={$t('course.navItem.lessons.exercises.all_exercises.previous')}
isDisabled={disablePreviousButton}
variant={VARIANTS.OUTLINED}
/>
@@ -1,5 +1,7 @@
<script lang="ts">
import TextField from '$lib/components/Form/TextField.svelte';
import { t } from '$lib/utils/functions/translations';
export let gradeMax = 0;
export let disableGrading = false;
export let grade: number | undefined;
@@ -8,7 +10,7 @@
{#if typeof grade !== 'undefined'}
<div class="flex items-center">
<TextField
placeholder="Points"
placeholder={$t('course.navItem.lessons.exercises.new_exercise_modal.points')}
bind:value={grade}
type="number"
className="w-12"
@@ -5,6 +5,7 @@
import RadioItem from '$lib/components/Form/RadioItem.svelte';
import HtmlRender from '$lib/components/HTMLRender/HTMLRender.svelte';
import Grade from '$lib/components/Question/Grade.svelte';
import { t } from '$lib/utils/functions/translations';
export let title = '';
export let index = 1;
@@ -103,7 +104,7 @@
<div class="mt-3 flex items-center justify-between w-full">
<PrimaryButton
onClick={handlePrevious}
label="Previous"
label={$t('course.navItem.lessons.exercises.all_exercises.previous')}
isDisabled={disablePreviousButton}
variant={VARIANTS.OUTLINED}
/>
@@ -5,6 +5,7 @@
import TextArea from '$lib/components/Form/TextArea.svelte';
import HtmlRender from '$lib/components/HTMLRender/HTMLRender.svelte';
import Grade from '$lib/components/Question/Grade.svelte';
import { t } from '$lib/utils/functions/translations';
export let title = '';
export let index = 1;
@@ -57,7 +58,11 @@
{defaultValue}
</div>
{:else}
<TextArea bind:value={defaultValue} rows="5" placeholder="Write your answer here" />
<TextArea
bind:value={defaultValue}
rows="5"
placeholder={$t('course.navItem.lessons.exercise.all_exercises.write_your_answer_here')}
/>
{/if}
</div>
@@ -72,7 +77,9 @@
<PrimaryButton
variant={VARIANTS.OUTLINED}
type="submit"
label={isLast ? 'Finish' : 'Next'}
label={isLast
? $t('course.navItem.lessons.exercise.all_exercises.finish')
: $t('course.navItem.lessons.exercise.all_exercises.next')}
{name}
/>
</div>
@@ -7,15 +7,15 @@ export const QUESTION_TYPE = {
export const QUESTION_TYPES = [
{
id: QUESTION_TYPE.RADIO,
label: 'Single answer'
label: 'course.navItem.lessons.exercises.all_exercises.edit_mode.question_types.single'
},
{
id: QUESTION_TYPE.CHECKBOX,
label: 'Multiple answers'
label: 'course.navItem.lessons.exercises.all_exercises.edit_mode.question_types.multiple'
},
{
id: QUESTION_TYPE.TEXTAREA,
label: 'Paragraph'
label: 'course.navItem.lessons.exercises.all_exercises.edit_mode.question_types.paragraph'
}
];