chore: translate list view #258

This commit is contained in:
Rotimi Best
2024-04-20 15:05:45 +01:00
parent ec30e076bc
commit 41aa45be9e
12 changed files with 106 additions and 43 deletions
@@ -63,26 +63,26 @@
<ContextMenu {target}> <ContextMenu {target}>
<ContextMenuOption <ContextMenuOption
indented indented
labelText={$t('courses.lesson_card.context_menu.clone')} labelText={$t('courses.course_card.context_menu.clone')}
icon={CopyFile} icon={CopyFile}
on:click={handleCloneCourse} on:click={handleCloneCourse}
/> />
<ContextMenuOption <ContextMenuOption
indented indented
labelText={$t('courses.lesson_card.context_menu.share')} labelText={$t('courses.course_card.context_menu.share')}
icon={Share} icon={Share}
on:click={handleShareCourse} on:click={handleShareCourse}
/> />
<ContextMenuOption <ContextMenuOption
indented indented
labelText={$t('courses.lesson_card.context_menu.invite')} labelText={$t('courses.course_card.context_menu.invite')}
icon={UserFollow} icon={UserFollow}
on:click={handleInvite} on:click={handleInvite}
/> />
<ContextMenuDivider /> <ContextMenuDivider />
<ContextMenuOption <ContextMenuOption
kind="danger" kind="danger"
labelText={$t('courses.lesson_card.context_menu.delete')} labelText={$t('courses.course_card.context_menu.delete')}
on:click={handleDeleteCourse} on:click={handleDeleteCourse}
/> />
</ContextMenu> </ContextMenu>
@@ -104,7 +104,7 @@
<svelte:fragment slot="loading"> <svelte:fragment slot="loading">
<SkeletonPlaceholder style="width: 100%; height: 200px;" /> <SkeletonPlaceholder style="width: 100%; height: 200px;" />
</svelte:fragment> </svelte:fragment>
<svelte:fragment slot="error">{$t('courses.lesson_card.error_message')}</svelte:fragment> <svelte:fragment slot="error">{$t('courses.course_card.error_message')}</svelte:fragment>
</ImageLoader> </ImageLoader>
</div> </div>
@@ -121,7 +121,7 @@
<div> <div>
<p class="text-xs pt-2 {!isLMS && 'pl-2'} dark:text-white"> <p class="text-xs pt-2 {!isLMS && 'pl-2'} dark:text-white">
{totalLessons} {totalLessons}
{$t('courses.lesson_card.lessons_number')} {$t('courses.course_card.lessons_number')}
</p> </p>
<p class="text-xs py-2"> <p class="text-xs py-2">
{#if isOnLandingPage} {#if isOnLandingPage}
@@ -139,9 +139,9 @@
{:else} {:else}
<Tag type={isPublished ? 'green' : 'cool-gray'}> <Tag type={isPublished ? 'green' : 'cool-gray'}>
{#if isPublished} {#if isPublished}
{$t('courses.lesson_card.published')} {$t('courses.course_card.published')}
{:else} {:else}
{$t('courses.lesson_card.unpublished')} {$t('courses.course_card.unpublished')}
{/if} {/if}
</Tag> </Tag>
{/if} {/if}
@@ -150,7 +150,7 @@
{#if isLMS} {#if isLMS}
<PrimaryButton <PrimaryButton
label={$t('courses.lesson_card.continue_course')} label={$t('courses.course_card.continue_course')}
variant={VARIANTS.OUTLINED} variant={VARIANTS.OUTLINED}
className="rounded-none" className="rounded-none"
/> />
@@ -158,7 +158,7 @@
<div class="flex flex-col justify-between"> <div class="flex flex-col justify-between">
<p class="text-xs pt-2 pl-2 dark:text-white"> <p class="text-xs pt-2 pl-2 dark:text-white">
{totalStudents} {totalStudents}
{$t('courses.lesson_card.students')} {$t('courses.course_card.students')}
</p> </p>
<div></div> <div></div>
</div> </div>
@@ -53,9 +53,9 @@
<StructuredListCell> <StructuredListCell>
<Tag class="break-normal" type={isPublished ? 'green' : 'cool-gray'}> <Tag class="break-normal" type={isPublished ? 'green' : 'cool-gray'}>
{#if isPublished} {#if isPublished}
Published {$t('courses.course_card.published')}
{:else} {:else}
Unpublished {$t('courses.course_card.unpublished')}
{/if} {/if}
</Tag> </Tag>
</StructuredListCell> </StructuredListCell>
@@ -69,20 +69,20 @@
}} }}
> >
<OverflowMenuItem <OverflowMenuItem
text={$t('courses.lesson_card.context_menu.clone')} text={$t('courses.course_card.context_menu.clone')}
on:click={handleCloneCourse} on:click={handleCloneCourse}
/> />
<OverflowMenuItem <OverflowMenuItem
text={$t('courses.lesson_card.context_menu.share')} text={$t('courses.course_card.context_menu.share')}
on:click={handleShareCourse} on:click={handleShareCourse}
/> />
<OverflowMenuItem <OverflowMenuItem
text={$t('courses.lesson_card.context_menu.invite')} text={$t('courses.course_card.context_menu.invite')}
on:click={handleInvite} on:click={handleInvite}
/> />
<OverflowMenuItem <OverflowMenuItem
danger danger
text={$t('courses.lesson_card.context_menu.delete')} text={$t('courses.course_card.context_menu.delete')}
on:click={handleDeleteCourse} on:click={handleDeleteCourse}
/> />
</OverflowMenu> </OverflowMenu>
@@ -14,12 +14,11 @@
StructuredListCell, StructuredListCell,
StructuredListBody StructuredListBody
} from 'carbon-components-svelte'; } from 'carbon-components-svelte';
import { isMobile } from '$lib/utils/store/useMobile';
import { t } from '$lib/utils/functions/translations'; import { t } from '$lib/utils/functions/translations';
export let courses: Course[] = []; export let courses: Course[] = [];
export let emptyTitle = $t('courses.lesson_card.empty_title'); export let emptyTitle = $t('courses.course_card.empty_title');
export let emptyDescription = $t('courses.lesson_card.empty_description'); export let emptyDescription = $t('courses.course_card.empty_description');
function calcProgressRate(progressRate?: number, totalLessons?: number): number { function calcProgressRate(progressRate?: number, totalLessons?: number): number {
if (!progressRate || !totalLessons) { if (!progressRate || !totalLessons) {
@@ -43,13 +42,21 @@
<StructuredList selection class="w-full"> <StructuredList selection class="w-full">
<StructuredListHead> <StructuredListHead>
<StructuredListRow head> <StructuredListRow head>
<StructuredListCell head>Title</StructuredListCell> <StructuredListCell head>
<StructuredListCell head>Description</StructuredListCell> {$t('courses.course_card.list_view.title')}
{#if !$isMobile} </StructuredListCell>
<StructuredListCell head>Lessons</StructuredListCell> <StructuredListCell head>
<StructuredListCell head>Students</StructuredListCell> {$t('courses.course_card.list_view.description')}
<StructuredListCell head>Published</StructuredListCell> </StructuredListCell>
{/if} <StructuredListCell head>
{$t('courses.course_card.list_view.lessons')}
</StructuredListCell>
<StructuredListCell head>
{$t('courses.course_card.list_view.students')}
</StructuredListCell>
<StructuredListCell head>
{$t('courses.course_card.list_view.published')}
</StructuredListCell>
<StructuredListCell head>{''}</StructuredListCell> <StructuredListCell head>{''}</StructuredListCell>
</StructuredListRow> </StructuredListRow>
</StructuredListHead> </StructuredListHead>
@@ -409,7 +409,7 @@
"published": "Veröffentlicht", "published": "Veröffentlicht",
"lessons": "Lektionen" "lessons": "Lektionen"
}, },
"lesson_card": { "course_card": {
"empty_title": "Keine Kurse erstellt", "empty_title": "Keine Kurse erstellt",
"empty_description": "Teilen Sie Ihr Wissen mit der Welt, indem Sie ansprechende Kurse für Ihre Schüler erstellen.", "empty_description": "Teilen Sie Ihr Wissen mit der Welt, indem Sie ansprechende Kurse für Ihre Schüler erstellen.",
"context_menu": { "context_menu": {
@@ -423,7 +423,14 @@
"students": "Schüler", "students": "Schüler",
"published": "Veröffentlicht", "published": "Veröffentlicht",
"unpublished": "Nicht veröffentlicht", "unpublished": "Nicht veröffentlicht",
"continue_course": "Kurs fortsetzen" "continue_course": "Kurs fortsetzen",
"list_view": {
"title": "Titel",
"description": "Beschreibung",
"lessons": "Lektionen",
"students": "Studenten",
"published": "Veröffentlicht"
}
}, },
"new_course_modal": { "new_course_modal": {
"heading": "Kurs erstellen", "heading": "Kurs erstellen",
@@ -417,7 +417,7 @@
"published": "Published", "published": "Published",
"lessons": "Lessons" "lessons": "Lessons"
}, },
"lesson_card": { "course_card": {
"empty_title": "No Courses Created", "empty_title": "No Courses Created",
"empty_description": "Share your knowledge with the world by creating engaging courses for your students.", "empty_description": "Share your knowledge with the world by creating engaging courses for your students.",
"context_menu": { "context_menu": {
@@ -431,7 +431,14 @@
"students": "students", "students": "students",
"published": "Published", "published": "Published",
"unpublished": "Unpublished", "unpublished": "Unpublished",
"continue_course": "Continue Course" "continue_course": "Continue Course",
"list_view": {
"title": "Title",
"description": "Description",
"lessons": "Lessons",
"students": "Students",
"published": "Published"
}
}, },
"new_course_modal": { "new_course_modal": {
"heading": "Create a Course", "heading": "Create a Course",
@@ -409,7 +409,7 @@
"published": "Publicado", "published": "Publicado",
"lessons": "Lecciones" "lessons": "Lecciones"
}, },
"lesson_card": { "course_card": {
"empty_title": "No se han creado cursos", "empty_title": "No se han creado cursos",
"empty_description": "Comparte tu conocimiento con el mundo creando cursos atractivos para tus estudiantes.", "empty_description": "Comparte tu conocimiento con el mundo creando cursos atractivos para tus estudiantes.",
"context_menu": { "context_menu": {
@@ -423,7 +423,14 @@
"students": "estudiantes", "students": "estudiantes",
"published": "Publicado", "published": "Publicado",
"unpublished": "No Publicado", "unpublished": "No Publicado",
"continue_course": "Continuar Curso" "continue_course": "Continuar Curso",
"list_view": {
"title": "Título",
"description": "Descripción",
"lessons": "Lecciones",
"students": "Estudiantes",
"published": "Publicado"
}
}, },
"new_course_modal": { "new_course_modal": {
"heading": "Crear un Curso", "heading": "Crear un Curso",
@@ -409,7 +409,7 @@
"published": "Publié", "published": "Publié",
"lessons": "Cours" "lessons": "Cours"
}, },
"lesson_card": { "course_card": {
"empty_title": "Aucun cours créé", "empty_title": "Aucun cours créé",
"empty_description": "Partagez vos connaissances avec le monde en créant des cours attrayants pour vos étudiants.", "empty_description": "Partagez vos connaissances avec le monde en créant des cours attrayants pour vos étudiants.",
"context_menu": { "context_menu": {
@@ -423,7 +423,14 @@
"students": "étudiants", "students": "étudiants",
"published": "Publié", "published": "Publié",
"unpublished": "Inédit", "unpublished": "Inédit",
"continue_course": "Continuer le cours" "continue_course": "Continuer le cours",
"list_view": {
"title": "Titre",
"description": "Description",
"lessons": "Leçons",
"students": "Étudiants",
"published": "Publié"
}
}, },
"new_course_modal": { "new_course_modal": {
"heading": "Créer un cours", "heading": "Créer un cours",
@@ -409,7 +409,7 @@
"published": "प्रकाशित", "published": "प्रकाशित",
"lessons": "पाठ" "lessons": "पाठ"
}, },
"lesson_card": { "course_card": {
"empty_title": "कोई पाठ्यक्रम नहीं बनाया गया", "empty_title": "कोई पाठ्यक्रम नहीं बनाया गया",
"empty_description": "अपने छात्रों के लिए आकर्षक पाठ्यक्रम बनाकर अपना ज्ञान दुनिया के साथ साझा करें।", "empty_description": "अपने छात्रों के लिए आकर्षक पाठ्यक्रम बनाकर अपना ज्ञान दुनिया के साथ साझा करें।",
"context_menu": { "context_menu": {
@@ -423,7 +423,14 @@
"students": "छात्र", "students": "छात्र",
"published": "प्रकाशित", "published": "प्रकाशित",
"unpublished": "अप्रकाशित", "unpublished": "अप्रकाशित",
"continue_course": "पाठ्यक्रम जारी रखें" "continue_course": "पाठ्यक्रम जारी रखें",
"list_view": {
"title": "शीर्षक",
"description": "विवरण",
"lessons": "सबक",
"students": "छात्र",
"published": "प्रकाशित"
}
}, },
"new_course_modal": { "new_course_modal": {
"heading": "एक कोर्स बनाएं", "heading": "एक कोर्स बनाएं",
@@ -409,7 +409,7 @@
"published": "Publicado", "published": "Publicado",
"lessons": "Aulas" "lessons": "Aulas"
}, },
"lesson_card": { "course_card": {
"empty_title": "Nenhum Curso Criado", "empty_title": "Nenhum Curso Criado",
"empty_description": "Compartilhe seu conhecimento com o mundo criando cursos envolventes para seus alunos.", "empty_description": "Compartilhe seu conhecimento com o mundo criando cursos envolventes para seus alunos.",
"context_menu": { "context_menu": {
@@ -423,7 +423,14 @@
"students": "alunos", "students": "alunos",
"published": "Publicado", "published": "Publicado",
"unpublished": "Não publicado", "unpublished": "Não publicado",
"continue_course": "Continuar Curso" "continue_course": "Continuar Curso",
"list_view": {
"title": "Título",
"description": "Descrição",
"lessons": "Lições",
"students": "Alunos",
"published": "Publicado"
}
}, },
"new_course_modal": { "new_course_modal": {
"heading": "Criar um Curso", "heading": "Criar um Curso",
@@ -409,7 +409,7 @@
"published": "Опубликовано", "published": "Опубликовано",
"lessons": "Уроки" "lessons": "Уроки"
}, },
"lesson_card": { "course_card": {
"empty_title": "Курсы не созданы", "empty_title": "Курсы не созданы",
"empty_description": "Поделитесь своими знаниями с миром, создавая увлекательные курсы для ваших студентов.", "empty_description": "Поделитесь своими знаниями с миром, создавая увлекательные курсы для ваших студентов.",
"context_menu": { "context_menu": {
@@ -423,7 +423,14 @@
"students": "студентов", "students": "студентов",
"published": "Опубликовано", "published": "Опубликовано",
"unpublished": "Не опубликовано", "unpublished": "Не опубликовано",
"continue_course": "Продолжить курс" "continue_course": "Продолжить курс",
"list_view": {
"title": "Название",
"description": "Описание",
"lessons": "Уроки",
"students": "Студенты",
"published": "Опубликовано"
}
}, },
"new_course_modal": { "new_course_modal": {
"heading": "Создать курс", "heading": "Создать курс",
@@ -409,7 +409,7 @@
"published": "Đã Xuất bản", "published": "Đã Xuất bản",
"lessons": "Bài học" "lessons": "Bài học"
}, },
"lesson_card": { "course_card": {
"empty_title": "Chưa có Khóa học nào được tạo", "empty_title": "Chưa có Khóa học nào được tạo",
"empty_description": "Chia sẻ kiến thức của bạn với thế giới bằng cách tạo các khóa học hấp dẫn cho học sinh của bạn.", "empty_description": "Chia sẻ kiến thức của bạn với thế giới bằng cách tạo các khóa học hấp dẫn cho học sinh của bạn.",
"context_menu": { "context_menu": {
@@ -423,7 +423,14 @@
"students": "học viên", "students": "học viên",
"published": "Đã Xuất bản", "published": "Đã Xuất bản",
"unpublished": "Chưa Xuất bản", "unpublished": "Chưa Xuất bản",
"continue_course": "Tiếp tục Khóa học" "continue_course": "Tiếp tục Khóa học",
"list_view": {
"title": "Tiêu đề",
"description": "Mô tả",
"lessons": "Bài học",
"students": "Sinh viên",
"published": "Đã xuất bản"
}
}, },
"new_course_modal": { "new_course_modal": {
"heading": "Tạo một Khóa học", "heading": "Tạo một Khóa học",
+1 -1
View File
@@ -1,7 +1,7 @@
module.exports = { module.exports = {
// ...rest of the Cypress project config // ...rest of the Cypress project config
projectId: '56i2dj', projectId: '56i2dj',
defaultCommandTimeout: 200000, defaultCommandTimeout: 300000,
e2e: { e2e: {
setupNodeEvents(on, config) { setupNodeEvents(on, config) {
// implement node event listeners here // implement node event listeners here