From a87358a3b394c7acb832d2f5aaa5517141bc8c93 Mon Sep 17 00:00:00 2001 From: EETagent Date: Thu, 26 Jan 2023 21:15:44 +0100 Subject: [PATCH] feat: add more translations --- .../(authenticated)/register/+page.svelte | 82 ++++++++++--------- frontend/src/translations/cs/index.ts | 1 + frontend/src/translations/i18n-types.ts | 8 ++ 3 files changed, 53 insertions(+), 38 deletions(-) diff --git a/frontend/src/routes/(candidate)/(authenticated)/register/+page.svelte b/frontend/src/routes/(candidate)/(authenticated)/register/+page.svelte index 4f01808..ca1f05f 100644 --- a/frontend/src/routes/(candidate)/(authenticated)/register/+page.svelte +++ b/frontend/src/routes/(candidate)/(authenticated)/register/+page.svelte @@ -25,7 +25,10 @@ import GradesTable from '$lib/components/grades/GradesTable.svelte'; import SchoolSelect from '$lib/components/select/SchoolSelect.svelte'; import PersonalIdConfirmCheckBox from '$lib/components/checkbox/PersonalIdConfirmCheckBox.svelte'; - import { deriveBirthdateFromPersonalId, isPersonalIdNumberWithBirthdateValid } from '$lib/utils/personalIdFormat'; + import { + deriveBirthdateFromPersonalId, + isPersonalIdNumberWithBirthdateValid + } from '$lib/utils/personalIdFormat'; let pageIndex = 0; let pagesFilled = [false, false, false, false, false, false, false, false]; @@ -72,9 +75,9 @@ schoolName: '', healthInsurance: '', grades: [], - firstSchool: {name: '', field: ''}, - secondSchool: {name: '', field: ''}, - testLanguage: '', + firstSchool: { name: '', field: '' }, + secondSchool: { name: '', field: '' }, + testLanguage: '' }, parents: [ { @@ -136,16 +139,17 @@ semester: yup.string().required() }) .required() - ).required(), + ) + .required(), firstSchool: yup.object().shape({ name: yup.string().required(), - field: yup.string().required(), + field: yup.string().required() }), secondSchool: yup.object().shape({ name: yup.string().required(), - field: yup.string().required(), + field: yup.string().required() }), - testLanguage: yup.string().required(), + testLanguage: yup.string().required() }), parents: yup.array().of( yup.object().shape({ @@ -276,8 +280,8 @@ const isPageInvalid = (index: number): boolean => { switch (index) { - case 0: - if ($typedErrors['personalIdOk'] || $typedErrors['personalIdErr']) { + case 0: + if ($typedErrors['personalIdOk'] || $typedErrors['personalIdErr']) { return true; } break; @@ -343,9 +347,12 @@ break; case 7: // @ts-ignore - if ($typedErrors["candidate"]["firstSchool"].name || $typedErrors["candidate"]["firstSchool"].field || + if ( + $typedErrors['candidate']['firstSchool'].name || + $typedErrors['candidate']['firstSchool'].field || // @ts-ignore - $typedErrors["candidate"]["secondSchool"].name || $typedErrors["candidate"]["secondSchool"].field + $typedErrors['candidate']['secondSchool'].name || + $typedErrors['candidate']['secondSchool'].field ) { return true; } @@ -363,7 +370,6 @@ return '+' + telephone.match(/[0-9]{1,3}/g)!.join(' '); }; - /* $form.candidate.personalIdNumber = data.whoami.personalIdNumber; const [birthdate, sex] = deriveBirthdateFromPersonalId(data.whoami.personalIdNumber); $form.candidate.birthdate = birthdate; @@ -473,17 +479,18 @@
+ /> - +
@@ -493,24 +500,24 @@ error={$typedErrors['candidate']['email']} bind:value={$form.candidate.email} placeholder={$LL.input.email()} - /> + /> - + + /> + error={$typedErrors['candidate']['city']} + bind:value={$form.candidate.city} + type="text" + placeholder={$LL.input.city()} + helperText="Uveďte poštovní směrovací číslo. (např. 602 00)" + />
@@ -550,7 +557,7 @@ options={['Česká republika', 'Slovenská republika', 'Ukrajina', 'Jiné']} /> - +
@@ -580,13 +587,13 @@ {:else} {/if}
@@ -605,14 +612,14 @@ error={$typedErrors['candidate']['schoolName']} type="number" bind:value={$form.candidate.schoolName} - placeholder="IZO školy" + placeholder={$LL.input.schoolIzo()} /> {:else} {/if} @@ -622,11 +629,10 @@ error={$typedErrors['candidate']['healthInsurance']} type="text" bind:value={$form.candidate.healthInsurance} - placeholder="Číslo zdravotní pojišťovny" - /> + placeholder={$LL.input.insuranceNumber()} + />
- {:else if pageIndex === 5}

{pageTexts[3]}

@@ -687,12 +693,12 @@ {:else if pageIndex === 7}

Přihlášky na školy

-
+
- + - +
{:else if pageIndex === 8} diff --git a/frontend/src/translations/cs/index.ts b/frontend/src/translations/cs/index.ts index 7e2e7c2..86c2888 100644 --- a/frontend/src/translations/cs/index.ts +++ b/frontend/src/translations/cs/index.ts @@ -134,6 +134,7 @@ const cs: BaseTranslation = { input: { optional: 'nepovinné', nameSurname: 'Jméno a příjmení', + birthSurname: "Rodné příjmení (pokud odlišné)", email: 'E-mail', telephone: 'Telefon', address: 'Ulice a č. p.', diff --git a/frontend/src/translations/i18n-types.ts b/frontend/src/translations/i18n-types.ts index 6af7424..41c923c 100644 --- a/frontend/src/translations/i18n-types.ts +++ b/frontend/src/translations/i18n-types.ts @@ -317,6 +317,10 @@ type RootTranslation = { * J​m​é​n​o​ ​a​ ​p​ř​í​j​m​e​n​í */ nameSurname: string + /** + * R​o​d​n​é​ ​p​ř​í​j​m​e​n​í​ ​(​p​o​k​u​d​ ​o​d​l​i​š​n​é​) + */ + birthSurname: string /** * E​-​m​a​i​l */ @@ -708,6 +712,10 @@ export type TranslationFunctions = { * Jméno a příjmení */ nameSurname: () => LocalizedString + /** + * Rodné příjmení (pokud odlišné) + */ + birthSurname: () => LocalizedString /** * E-mail */