Skip to content

Commit

Permalink
VKT(Frontend): Move fixed UI strings to translation files [deploy]
Browse files Browse the repository at this point in the history
  • Loading branch information
pkoivisto committed Dec 20, 2024
1 parent dbdf676 commit 8d0d21d
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 18 deletions.
21 changes: 21 additions & 0 deletions frontend/packages/vkt/public/i18n/fi-FI/examiner.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,24 @@
{
"vkt": {
"component": {
"enrollmentAppointment": {
"gradeModal": {
"grade": "Arvosana",
"gradeComments": "Huomautuksia",
"partialExam": "Osakoe",
"title": "Anna arvosanat"
},
"historyModal": {
"title": "Aiempien tutkintojen tiedot"
}
},
"examinerContactRequest": {
"contactRequest": "Yhteydenottopyyntö",
"contactFields": "Yhteystiedot",
"lastName": "Sukunimi",
"firstName": "Etunimi",
"email": "Sähköpostiosoite",
"examination": "Tutkinto",
"phoneNumber": "Puhelinnumero",
"partialExams": "Osakokeet, jotka haluan suorittaa",
"previousExams": "Osallistunut aiempiin tutkintoihin?",
Expand Down Expand Up @@ -90,13 +102,15 @@
"fillings": "Paikkoja täytetty",
"hidden": "Piilotettu",
"isPublic": "Näytä tutkintopäivä julkisesti",
"languagePlaceAndTime": "Tutkinnon kieli, aika ja paikka",
"languageAndLevel": "Kieli ja taso",
"location": "Tutkintopaikan tarkka osoite",
"maxParticipants": "Paikkojen lukumäärä",
"municipality": "Tutkintopaikka",
"previousEnrollment": "Aikaisempi osallistuminen valtionhallinnon kielitutkintoon",
"registrationCloses": "Ilmoittautuminen päättyy"
},
"heading": "Tutkinnon tiedot",
"payment": {
"create": "Luo maksulinkki",
"setRefunded": "Merkitse maksu palautetuksi",
Expand All @@ -119,6 +133,13 @@
"historyTitle": "Maksuhistoria",
"recentTitle": "Maksun tila"
},
"paymentStatus": {
"DELAYED": "Myöhässä",
"FAIL": "Peruttu",
"NEW": "Aloitettu",
"OK": "Maksettu",
"PENDING": "Odottaa"
},
"status": "Ilmoittautumisen tila"
},
"examinerExamEventUpsert": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -355,11 +355,11 @@ const ExamAndEnrollmentDetailsSection = ({
return (
<>
<div className="columns margin-top-lg space-between">
<H2>Tutkinnon tiedot</H2>
<H2>{t('heading')}</H2>
</div>
{enrollment.examEvent && (
<div className="rows">
<H3>Tutkinnon kieli, aika ja paikka</H3>
<H3>{t('header.languagePlaceAndTime')}</H3>
<Text>
{translateCommon(`examLanguage.${enrollment.examEvent.language}`)}
{', '}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
import { APIResponseStatus, Color, Variant } from 'shared/enums';

import { EnrollmentSkillsListTable } from 'components/clerkEnrollment/appointment/EnrollmentSkillsListTable';
import { useCommonTranslation } from 'configs/i18n';
import { useCommonTranslation, useExaminerTranslation } from 'configs/i18n';
import { useAppDispatch, useAppSelector } from 'configs/redux';
import { ExamLevel } from 'enums/app';
import { ClerkEnrollmentAppointmentHistory } from 'interfaces/clerkEnrollment';
Expand All @@ -34,6 +34,9 @@ export const EnrollmentHistoryModal = ({
}) => {
const dispatch = useAppDispatch();
const translateCommon = useCommonTranslation();
const { t } = useExaminerTranslation({
keyPrefix: 'vkt.component.enrollmentAppointment.historyModal',
});
const { historyStatus, enrollmentHistory } = useAppSelector(
clerkEnrollmentAppointmentSelector,
);
Expand All @@ -46,11 +49,7 @@ export const EnrollmentHistoryModal = ({
}, [dispatch, historyStatus, enrollmentId, oid]);

return (
<CustomModal
onCloseModal={closeModal}
open={open}
modalTitle={'Aiempien tutkintojen tiedot'}
>
<CustomModal onCloseModal={closeModal} open={open} modalTitle={t('title')}>
<>
<div style={{ width: '60vw' }} className="rows gapped-sm">
<LoadingProgressIndicator displayBlock={true} isLoading={isLoading}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
Variant,
} from 'shared/enums';

import { useCommonTranslation } from 'configs/i18n';
import { useCommonTranslation, useExaminerTranslation } from 'configs/i18n';
import { useAppDispatch, useAppSelector } from 'configs/redux';
import { ExamGrades } from 'enums/app';
import {
Expand Down Expand Up @@ -47,6 +47,9 @@ export const GradeModal = ({
oid: string;
}) => {
const translateCommon = useCommonTranslation();
const { t } = useExaminerTranslation({
keyPrefix: 'vkt.component.enrollmentAppointment.gradeModal',
});
const dispatch = useAppDispatch();
const exams: Array<keyof GradedExams> = [
'writingPartialExam',
Expand Down Expand Up @@ -115,17 +118,13 @@ export const GradeModal = ({
];

return (
<CustomModal
onCloseModal={closeModal}
open={open}
modalTitle={'Anna arvosanat'}
>
<CustomModal onCloseModal={closeModal} open={open} modalTitle={t('title')}>
<>
<div style={{ width: '60vw' }} className="rows gapped-sm">
<div style={{ margin: '2em' }} className="grid-3-columns gapped">
<Text className="bold">Osakoe</Text>
<Text className="bold">Arvosana</Text>
<Text className="bold">Huomautuksia</Text>
<Text className="bold">{t('partialExam')}</Text>
<Text className="bold">{t('grade')}</Text>
<Text className="bold">{t('gradeComments')}</Text>
{selectedSkills.map((skill: keyof GradedExams, index) => (
<Fragment key={index}>
<Text>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ export const ClerkEnrollmentContactRequestPage: FC = () => {
<div className="half-max-width">
<ComboBox
autoHighlight
label={'Tutkinto'}
label={t('examination')}
values={[...examEvents]
.map(examEventToOption)
.sort((a, b) => a.label.localeCompare(b.label))}
Expand Down

0 comments on commit 8d0d21d

Please sign in to comment.