🚸 Improve substitution texts
This commit is contained in:
@ -44,9 +44,10 @@ const chars = {
|
|||||||
<span class="text" v-else
|
<span class="text" v-else
|
||||||
>{{
|
>{{
|
||||||
$t(getSubstitutionText(event.change), {
|
$t(getSubstitutionText(event.change), {
|
||||||
subject: event.change.subject,
|
subject: event.change.change.subject,
|
||||||
class: event.change.class.join(", "),
|
class: event.change.class.join(", "),
|
||||||
teacher: event.change.change.teacher || event.change.teacher,
|
teacher: event.change.teacher,
|
||||||
|
new_teacher: event.change.change.teacher,
|
||||||
room: event.change.change.room,
|
room: event.change.change.room,
|
||||||
})
|
})
|
||||||
}}<span class="notes" v-if="event.change.notes">
|
}}<span class="notes" v-if="event.change.notes">
|
||||||
|
@ -23,7 +23,8 @@ const substitutionsForDate = computed(() => {
|
|||||||
$t(getSubstitutionText(substitution), {
|
$t(getSubstitutionText(substitution), {
|
||||||
subject: substitution.change.subject,
|
subject: substitution.change.subject,
|
||||||
class: substitution.class.join(", "),
|
class: substitution.class.join(", "),
|
||||||
teacher: substitution.change.teacher || substitution.teacher,
|
teacher: substitution.teacher,
|
||||||
|
new_teacher: substitution.change.teacher,
|
||||||
room: substitution.change.room,
|
room: substitution.change.room,
|
||||||
})
|
})
|
||||||
}}</span>
|
}}</span>
|
||||||
|
@ -62,17 +62,16 @@ export const strings = {
|
|||||||
text: {
|
text: {
|
||||||
withClass: {
|
withClass: {
|
||||||
subjectChange:
|
subjectChange:
|
||||||
"Lesson changed for {class} in {subject} with {teacher} in room {room}",
|
"Lesson for {class} in {subject} with {teacher} now in room {room}",
|
||||||
teacherChange: "Lesson for {class} in {subject} now with {teacher}",
|
teacherChange:
|
||||||
roomChange:
|
"Lesson for {class} in {subject} with {teacher} now with {new_teacher} in room {room}",
|
||||||
"Room for lesson {subject} for {class} with {teacher} is now {room}",
|
|
||||||
cancellation: "Lesson for {class} with {teacher} is cancelled",
|
cancellation: "Lesson for {class} with {teacher} is cancelled",
|
||||||
},
|
},
|
||||||
withoutClass: {
|
withoutClass: {
|
||||||
subjectChange:
|
subjectChange:
|
||||||
"Lesson changed in {subject} with {teacher} in room {room}",
|
"Lesson in {subject} with {teacher} now in room {room}",
|
||||||
teacherChange: "Lesson in {subject} now with {teacher}",
|
teacherChange:
|
||||||
roomChange: "Room for lesson {subject} with {teacher} is now {room}",
|
"Lesson in {subject} with {teacher} now with {new_teacher} in room {room}",
|
||||||
cancellation: "Lesson with {teacher} is cancelled",
|
cancellation: "Lesson with {teacher} is cancelled",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -141,19 +140,17 @@ export const strings = {
|
|||||||
text: {
|
text: {
|
||||||
withClass: {
|
withClass: {
|
||||||
subjectChange:
|
subjectChange:
|
||||||
"Unterricht geändert für die Klasse {class} in {subject} mit {teacher} in Raum {room}",
|
"Unterricht für die Klasse {class} im Fach {subject} mit {teacher} jetzt in Raum {room}",
|
||||||
teacherChange:
|
teacherChange:
|
||||||
"Unterricht geändert für die Klasse {class} in {subject} jetzt mit {teacher}",
|
"Unterricht für die Klasse {class} im Fach {subject} mit {teacher} jetzt mit {new_teacher} in Raum {room}",
|
||||||
roomChange:
|
cancellation:
|
||||||
"Der Raum für das Fach {subject} für die Klasse {class} mit {teacher} ist jetzt {room}",
|
"Unterricht für die Klasse {class} mit {teacher} fällt aus",
|
||||||
cancellation: "Unterricht für Klasse {class} mit {teacher} fällt aus",
|
|
||||||
},
|
},
|
||||||
withoutClass: {
|
withoutClass: {
|
||||||
subjectChange:
|
subjectChange:
|
||||||
"Unterricht geändert in {subject} mit {teacher} in Raum {room}",
|
"Unterricht im Fach {subject} mit {teacher} jetzt in Raum {room}",
|
||||||
teacherChange: "Unterricht in {subject} jetzt mit {teacher}",
|
teacherChange:
|
||||||
roomChange:
|
"Unterricht im Fach {subject} mit {teacher} jetzt mit {new_teacher} in Raum {room}",
|
||||||
"Raum für das Fach {subject} mit {teacher} ist jetzt {room}",
|
|
||||||
cancellation: "Unterricht mit {teacher} fällt aus",
|
cancellation: "Unterricht mit {teacher} fällt aus",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -6,7 +6,14 @@ export function getSubstitutionText(substitution) {
|
|||||||
|
|
||||||
// TODO: implement more texts
|
// TODO: implement more texts
|
||||||
if (substitution.type == "change") {
|
if (substitution.type == "change") {
|
||||||
return `substitution.text.${includeClassValue}.subjectChange`;
|
if (
|
||||||
|
substitution.teacher == substitution.change.teacher ||
|
||||||
|
!substitution.change.teacher
|
||||||
|
) {
|
||||||
|
return `substitution.text.${includeClassValue}.subjectChange`;
|
||||||
|
} else {
|
||||||
|
return `substitution.text.${includeClassValue}.teacherChange`;
|
||||||
|
}
|
||||||
} else if (substitution.type == "cancellation") {
|
} else if (substitution.type == "cancellation") {
|
||||||
return `substitution.text.${includeClassValue}.cancellation`;
|
return `substitution.text.${includeClassValue}.cancellation`;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user