Skip to content

Commit

Permalink
i18n
Browse files Browse the repository at this point in the history
  • Loading branch information
mattiscauwel committed May 21, 2024
1 parent b31a114 commit 27716b4
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 72 deletions.

This file was deleted.

This file was deleted.

5 changes: 5 additions & 0 deletions frontend/src/i18n/locales/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,11 @@ export default {
email_invalid: "Provided email is invalid",
},

patch_subject: {
cancel_dialog: "Cancel editing subject?",
edit_subject: "Edit subject",
},

group: {
not_found: "Group not found",
not_found2: "No groups found",
Expand Down
5 changes: 5 additions & 0 deletions frontend/src/i18n/locales/nl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,11 @@ export default {
email_invalid: "Ingevoerde email is ongeldig",
},

patch_subject: {
cancel_dialog: "Wijzigingen annuleren?",
edit_subject: "Wijzig vak",
},

group: {
not_found: "Groep niet gevonden",
not_found2: "Geen groepen teruggevonden",
Expand Down
35 changes: 22 additions & 13 deletions frontend/src/views/subject/modify/CreateSubjectView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,22 @@
{{ $t("create_subject.error_snackbar") }}
</v-snackbar>

<ModifySubjectDialog
dialog="dialog"
@update:dialog="dialog = $event"
@confirm-button-clicked="router.push({ name: 'subjects' })"
></ModifySubjectDialog>

<v-dialog v-model="dialog" max-width="290" persistent>
<v-card>
<v-card-title class="headline">
{{ $t("create_subject.cancel_dialog") }}
</v-card-title>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="blue darken-1" @click="dialog = false">
{{ $t("default.no_capital") }}
</v-btn>
<v-btn color="blue darken-1" @click="router.push({ name: 'subjects' })">
{{ $t("default.yes_capital") }}
</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
<div class="flex-container">
<ModifySubjectHeaderContainer
:title="$t('create_subject.new_subject')"
Expand Down Expand Up @@ -60,16 +70,15 @@
</template>

<script setup lang="ts">
import {computed, ref} from "vue";
import { computed, ref } from "vue";
import useAcademicYear from "@/composables/useAcademicYear";
import {useCreateSubjectInstructorMutation, useCreateSubjectMutation} from "@/queries/Subject";
import { useCreateSubjectInstructorMutation, useCreateSubjectMutation } from "@/queries/Subject";
import type SubjectForm from "@/models/Subject";
import type User from "@/models/User";
import {useCurrentUserQuery} from "@/queries/User";
import { useCurrentUserQuery } from "@/queries/User";
import ModifySubjectHeaderContainer from "@/components/subject/modify/header/ModifySubjectHeaderContainer.vue";
import ModifySubjectBody from "@/components/subject/modify/body/ModifySubjectBody.vue";
import {useRouter} from "vue-router";
import ModifySubjectDialog from "@/components/subject/modify/extra/ModifySubjectDialog.vue";
import { useRouter } from "vue-router";
const snackbar = ref(false);
const dialog = ref(false);
Expand All @@ -82,7 +91,7 @@ const instructors = ref<User[]>([]);
const currentUserAsInstructor = ref(true);
const subjectId = ref<number | undefined>(undefined);
const {data: currentUser, isLoading, isError} = useCurrentUserQuery();
const { data: currentUser, isLoading, isError } = useCurrentUserQuery();
const createSubjectMutation = useCreateSubjectMutation();
const createSubjectInstructorMutation = useCreateSubjectInstructorMutation();
Expand Down Expand Up @@ -173,7 +182,7 @@ async function handleSubmit() {
});
}
await router.push({name: "subject", params: {subjectId: subjectId.value}});
await router.push({ name: "subject", params: { subjectId: subjectId.value } });
} catch (error) {
console.error("Error during subject creation:", error);
}
Expand Down
6 changes: 3 additions & 3 deletions frontend/src/views/subject/modify/PatchSubjectView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,22 @@
<v-dialog v-model="dialog" max-width="290" persistent>
<v-card>
<v-card-title class="headline">
{{ $t("create_subject.cancel_dialog") }}
{{ $t("patch_subject.cancel_dialog") }}
</v-card-title>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="blue darken-1" @click="dialog = false">
{{ $t("default.no_capital") }}
</v-btn>
<v-btn color="blue darken-1" @click="router.push({ name: 'subjects' })">
<v-btn color="blue darken-1" @click="router.push({ name: 'subject' , params: {subjectId: subjectId}})">
{{ $t("default.yes_capital") }}
</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
<div class="flex-container">
<ModifySubjectHeaderContainer
title="Edit Subject"
:title="$t('patch_subject.edit_subject')"
:image-path="`https://www.ugent.be/img/dcom/faciliteiten/ufo-logo.png`"
:subject-name="subject!.name"
:academic-year="subject!.academic_year"
Expand Down

0 comments on commit 27716b4

Please sign in to comment.