mirror of
https://github.com/danbulant/Portfolio
synced 2026-06-09 09:41:37 +00:00
feat: translate register inputs
This commit is contained in:
parent
2d11b40244
commit
0064f58fb6
3 changed files with 213 additions and 36 deletions
|
|
@ -1,4 +1,6 @@
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
|
import LL from '$i18n/i18n-svelte';
|
||||||
|
|
||||||
import { goto } from '$app/navigation';
|
import { goto } from '$app/navigation';
|
||||||
import { apiFillDetails } from '$lib/@api/candidate';
|
import { apiFillDetails } from '$lib/@api/candidate';
|
||||||
import Submit from '$lib/components/button/Submit.svelte';
|
import Submit from '$lib/components/button/Submit.svelte';
|
||||||
|
|
@ -61,7 +63,7 @@
|
||||||
schoolName: '',
|
schoolName: '',
|
||||||
healthInsurance: '',
|
healthInsurance: '',
|
||||||
grades: [],
|
grades: [],
|
||||||
testLanguage: '',
|
testLanguage: ''
|
||||||
},
|
},
|
||||||
parents: [
|
parents: [
|
||||||
{
|
{
|
||||||
|
|
@ -121,8 +123,9 @@
|
||||||
semester: yup.string().required()
|
semester: yup.string().required()
|
||||||
})
|
})
|
||||||
.required()
|
.required()
|
||||||
).required(),
|
)
|
||||||
testLanguage: yup.string().required(),
|
.required(),
|
||||||
|
testLanguage: yup.string().required()
|
||||||
}),
|
}),
|
||||||
parents: yup.array().of(
|
parents: yup.array().of(
|
||||||
yup.object().shape({
|
yup.object().shape({
|
||||||
|
|
@ -364,7 +367,7 @@
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 7:
|
case 7:
|
||||||
if ($typedErrors["candidate"]["grades"].length > 0) return true;
|
if ($typedErrors['candidate']['grades'].length > 0) return true;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -452,10 +455,7 @@
|
||||||
<a href="/bezpecnost" class="text-sspsBlue underline"> zde</a>.
|
<a href="/bezpecnost" class="text-sspsBlue underline"> zde</a>.
|
||||||
</p>
|
</p>
|
||||||
<div class="field">
|
<div class="field">
|
||||||
<GdprCheckBox
|
<GdprCheckBox bind:value={$form.gdpr} error={$typedErrors['gdpr']} />
|
||||||
bind:value={$form.gdpr}
|
|
||||||
error={$typedErrors['gdpr']}
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
{:else if pageIndex === 2}
|
{:else if pageIndex === 2}
|
||||||
|
|
@ -471,21 +471,21 @@
|
||||||
error={$typedErrors['candidate']['name'] || $typedErrors['candidate']['surname']}
|
error={$typedErrors['candidate']['name'] || $typedErrors['candidate']['surname']}
|
||||||
bind:valueName={$form.candidate.name}
|
bind:valueName={$form.candidate.name}
|
||||||
bind:valueSurname={$form.candidate.surname}
|
bind:valueSurname={$form.candidate.surname}
|
||||||
placeholder="Jméno a příjmení"
|
placeholder="{$LL.input.nameSurname()}"
|
||||||
/>
|
/>
|
||||||
</span>
|
</span>
|
||||||
<span class="field">
|
<span class="field">
|
||||||
<EmailField
|
<EmailField
|
||||||
error={$typedErrors['candidate']['email']}
|
error={$typedErrors['candidate']['email']}
|
||||||
bind:value={$form.candidate.email}
|
bind:value={$form.candidate.email}
|
||||||
placeholder="E-mail"
|
placeholder="{$LL.input.email()}"
|
||||||
/>
|
/>
|
||||||
</span>
|
</span>
|
||||||
<span class="field">
|
<span class="field">
|
||||||
<TelephoneField
|
<TelephoneField
|
||||||
error={$typedErrors['candidate']['telephone']}
|
error={$typedErrors['candidate']['telephone']}
|
||||||
bind:value={$form.candidate.telephone}
|
bind:value={$form.candidate.telephone}
|
||||||
placeholder="Telefon"
|
placeholder="{$LL.input.telephone()}"
|
||||||
/>
|
/>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -503,7 +503,7 @@
|
||||||
$typedErrors['candidate']['houseNumber']}
|
$typedErrors['candidate']['houseNumber']}
|
||||||
bind:valueName={$form.candidate.street}
|
bind:valueName={$form.candidate.street}
|
||||||
bind:valueSurname={$form.candidate.houseNumber}
|
bind:valueSurname={$form.candidate.houseNumber}
|
||||||
placeholder="Ulice a č. p."
|
placeholder={$LL.input.address()}
|
||||||
helperText="Uveďte ulici a číslo popisné (např. Preslova 72)."
|
helperText="Uveďte ulici a číslo popisné (např. Preslova 72)."
|
||||||
/>
|
/>
|
||||||
</span>
|
</span>
|
||||||
|
|
@ -512,7 +512,7 @@
|
||||||
error={$typedErrors['candidate']['zip']}
|
error={$typedErrors['candidate']['zip']}
|
||||||
bind:value={$form.candidate.zip}
|
bind:value={$form.candidate.zip}
|
||||||
type="number"
|
type="number"
|
||||||
placeholder="PSČ"
|
placeholder={$LL.input.zipCode()}
|
||||||
helperText="Uveďte poštovní směrovací číslo. (např. 602 00)"
|
helperText="Uveďte poštovní směrovací číslo. (např. 602 00)"
|
||||||
/>
|
/>
|
||||||
</span>
|
</span>
|
||||||
|
|
@ -523,7 +523,7 @@
|
||||||
error={$typedErrors['candidate']['city']}
|
error={$typedErrors['candidate']['city']}
|
||||||
bind:value={$form.candidate.city}
|
bind:value={$form.candidate.city}
|
||||||
type="text"
|
type="text"
|
||||||
placeholder="Město"
|
placeholder={$LL.input.city()}
|
||||||
helperText="Uveďte město"
|
helperText="Uveďte město"
|
||||||
/>
|
/>
|
||||||
</span>
|
</span>
|
||||||
|
|
@ -532,7 +532,7 @@
|
||||||
error={$typedErrors['candidate']['birthplace']}
|
error={$typedErrors['candidate']['birthplace']}
|
||||||
bind:value={$form.candidate.birthplace}
|
bind:value={$form.candidate.birthplace}
|
||||||
type="text"
|
type="text"
|
||||||
placeholder="Místo narození"
|
placeholder={$LL.input.birthPlace()}
|
||||||
helperText="Uveďte město"
|
helperText="Uveďte město"
|
||||||
icon
|
icon
|
||||||
>
|
>
|
||||||
|
|
@ -548,7 +548,7 @@
|
||||||
error={$typedErrors['candidate']['birthdate']}
|
error={$typedErrors['candidate']['birthdate']}
|
||||||
bind:value={$form.candidate.birthdate}
|
bind:value={$form.candidate.birthdate}
|
||||||
type="text"
|
type="text"
|
||||||
placeholder="Datum narození"
|
placeholder={$LL.input.birthDate()}
|
||||||
helperText="TODO: (Uveďte ve formátu DD.MM.RRRR)"
|
helperText="TODO: (Uveďte ve formátu DD.MM.RRRR)"
|
||||||
/>
|
/>
|
||||||
<div class="ml-2">
|
<div class="ml-2">
|
||||||
|
|
@ -556,7 +556,7 @@
|
||||||
error={$typedErrors['candidate']['sex']}
|
error={$typedErrors['candidate']['sex']}
|
||||||
bind:value={$form.candidate.sex}
|
bind:value={$form.candidate.sex}
|
||||||
options={['Žena', 'Muž']}
|
options={['Žena', 'Muž']}
|
||||||
placeholder="Pohlaví"
|
placeholder={$LL.input.sex()}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -571,21 +571,21 @@
|
||||||
error={$typedErrors['parents'][0]['name'] || $typedErrors['parents'][0]['surname']}
|
error={$typedErrors['parents'][0]['name'] || $typedErrors['parents'][0]['surname']}
|
||||||
bind:valueName={$form.parents[0].name}
|
bind:valueName={$form.parents[0].name}
|
||||||
bind:valueSurname={$form.parents[0].surname}
|
bind:valueSurname={$form.parents[0].surname}
|
||||||
placeholder="Jméno a příjmení zákonného zástupce"
|
placeholder={$LL.input.parent.nameSurname()}
|
||||||
/>
|
/>
|
||||||
</span>
|
</span>
|
||||||
<span class="field">
|
<span class="field">
|
||||||
<EmailField
|
<EmailField
|
||||||
error={$typedErrors['parents'][0]['email']}
|
error={$typedErrors['parents'][0]['email']}
|
||||||
bind:value={$form.parents[0].email}
|
bind:value={$form.parents[0].email}
|
||||||
placeholder="E-mail zákonného zástupce"
|
placeholder={$LL.input.parent.email()}
|
||||||
/>
|
/>
|
||||||
</span>
|
</span>
|
||||||
<span class="field">
|
<span class="field">
|
||||||
<TelephoneField
|
<TelephoneField
|
||||||
error={$typedErrors['parents'][0]['telephone']}
|
error={$typedErrors['parents'][0]['telephone']}
|
||||||
bind:value={$form.parents[0].telephone}
|
bind:value={$form.parents[0].telephone}
|
||||||
placeholder="Telefon zákonného zástupce"
|
placeholder={$LL.input.parent.telephone()}
|
||||||
/>
|
/>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -600,21 +600,21 @@
|
||||||
error={$typedErrors['parents'][1]['name'] || $typedErrors['parents'][1]['surname']}
|
error={$typedErrors['parents'][1]['name'] || $typedErrors['parents'][1]['surname']}
|
||||||
bind:valueName={$form.parents[1].name}
|
bind:valueName={$form.parents[1].name}
|
||||||
bind:valueSurname={$form.parents[1].surname}
|
bind:valueSurname={$form.parents[1].surname}
|
||||||
placeholder="Jméno a příjmení zákonného zástupce (nepovinné)"
|
placeholder={`${$LL.input.parent.nameSurname()} (${$LL.input.optional()})`}
|
||||||
/>
|
/>
|
||||||
</span>
|
</span>
|
||||||
<span class="field">
|
<span class="field">
|
||||||
<EmailField
|
<EmailField
|
||||||
error={$typedErrors['parents'][1]['email']}
|
error={$typedErrors['parents'][1]['email']}
|
||||||
bind:value={$form.parents[1].email}
|
bind:value={$form.parents[1].email}
|
||||||
placeholder="E-mail zákonného zástupce (nepovinné)"
|
placeholder={`${$LL.input.parent.email()} (${$LL.input.optional()})`}
|
||||||
/>
|
/>
|
||||||
</span>
|
</span>
|
||||||
<span class="field">
|
<span class="field">
|
||||||
<TelephoneField
|
<TelephoneField
|
||||||
error={$typedErrors['parents'][1]['telephone']}
|
error={$typedErrors['parents'][1]['telephone']}
|
||||||
bind:value={$form.parents[1].telephone}
|
bind:value={$form.parents[1].telephone}
|
||||||
placeholder="Telefon zákonného zástupce (nepovinné)"
|
placeholder={`${$LL.input.parent.telephone()} (${$LL.input.optional()})`}
|
||||||
/>
|
/>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -630,15 +630,15 @@
|
||||||
<SelectField
|
<SelectField
|
||||||
error={$typedErrors['candidate']['citizenship']}
|
error={$typedErrors['candidate']['citizenship']}
|
||||||
bind:value={$form.candidate.citizenship}
|
bind:value={$form.candidate.citizenship}
|
||||||
placeholder="Občanství"
|
placeholder={$LL.input.citizenship()}
|
||||||
options={['Česká republika', 'Slovenská republika', 'Ukrajina', 'Jiné']}
|
options={['Česká republika', 'Slovenská republika', 'Ukrajina', 'Jiné']}
|
||||||
/>
|
/>
|
||||||
</span>
|
</span>
|
||||||
<span class="w-[50%] ml-2">
|
<span class="ml-2 w-[50%]">
|
||||||
<SelectField
|
<SelectField
|
||||||
error={$typedErrors['candidate']['testLanguage']}
|
error={$typedErrors['candidate']['testLanguage']}
|
||||||
bind:value={$form.candidate.testLanguage}
|
bind:value={$form.candidate.testLanguage}
|
||||||
placeholder="Jazyk odborných testů"
|
placeholder={$LL.input.testLanguage()}
|
||||||
options={['Čeština', 'Angličtina']}
|
options={['Čeština', 'Angličtina']}
|
||||||
/>
|
/>
|
||||||
</span>
|
</span>
|
||||||
|
|
@ -650,14 +650,14 @@
|
||||||
error={$typedErrors['candidate']['schoolName']}
|
error={$typedErrors['candidate']['schoolName']}
|
||||||
type="number"
|
type="number"
|
||||||
bind:value={$form.candidate.schoolName}
|
bind:value={$form.candidate.schoolName}
|
||||||
placeholder="IZO školy"
|
placeholder={$LL.input.schoolIzo()}
|
||||||
/>
|
/>
|
||||||
{:else}
|
{:else}
|
||||||
<TextField
|
<TextField
|
||||||
error={$typedErrors['candidate']['schoolName']}
|
error={$typedErrors['candidate']['schoolName']}
|
||||||
type="text"
|
type="text"
|
||||||
bind:value={$form.candidate.schoolName}
|
bind:value={$form.candidate.schoolName}
|
||||||
placeholder="Název školy"
|
placeholder={$LL.input.schoolName()}
|
||||||
/>
|
/>
|
||||||
{/if}
|
{/if}
|
||||||
</span>
|
</span>
|
||||||
|
|
@ -667,7 +667,7 @@
|
||||||
error={$typedErrors['candidate']['healthInsurance']}
|
error={$typedErrors['candidate']['healthInsurance']}
|
||||||
type="text"
|
type="text"
|
||||||
bind:value={$form.candidate.healthInsurance}
|
bind:value={$form.candidate.healthInsurance}
|
||||||
placeholder="Číslo zdravotní pojišťovny"
|
placeholder={$LL.input.insuranceNumber()}
|
||||||
/>
|
/>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -677,13 +677,13 @@
|
||||||
<IdField
|
<IdField
|
||||||
error={$typedErrors['candidate']['personalIdNumber']}
|
error={$typedErrors['candidate']['personalIdNumber']}
|
||||||
bind:value={$form.candidate.personalIdNumber}
|
bind:value={$form.candidate.personalIdNumber}
|
||||||
placeholder="Rodné číslo"
|
placeholder={$LL.input.personalIdentificationNumber()}
|
||||||
/>
|
/>
|
||||||
{:else}
|
{:else}
|
||||||
<TextField
|
<TextField
|
||||||
error={$typedErrors['candidate']['personalIdNumber']}
|
error={$typedErrors['candidate']['personalIdNumber']}
|
||||||
bind:value={$form.candidate.personalIdNumber}
|
bind:value={$form.candidate.personalIdNumber}
|
||||||
placeholder="Rodné číslo"
|
placeholder={$LL.input.personalIdentificationNumber()}
|
||||||
/>
|
/>
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -48,10 +48,31 @@ const cs: BaseTranslation = {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
input: {
|
input: {
|
||||||
|
optional: 'nepovinné',
|
||||||
|
nameSurname: 'Jméno a příjmení',
|
||||||
|
email: 'E-mail',
|
||||||
|
telephone: 'Telefon',
|
||||||
|
address: 'Ulice a č. p.',
|
||||||
|
zipCode: 'PSČ',
|
||||||
|
city: 'Město',
|
||||||
|
birthPlace: 'Místo narození',
|
||||||
|
birthDate: 'Datum narození',
|
||||||
|
sex: 'Pohlaví',
|
||||||
|
citizenship: 'Občanství',
|
||||||
|
testLanguage: 'Jazyk odborných testů',
|
||||||
|
schoolIzo: "IZO školy",
|
||||||
|
schoolName: "Název školy",
|
||||||
|
insuranceNumber: 'Číslo zdravotní pojišťovny',
|
||||||
|
personalIdentificationNumber: 'Rodné číslo',
|
||||||
evidenceNumber: 'Ev. číslo',
|
evidenceNumber: 'Ev. číslo',
|
||||||
adminId: 'Admin Id',
|
adminId: 'Admin Id',
|
||||||
password: 'Heslo',
|
password: 'Heslo',
|
||||||
submit: 'Odeslat'
|
submit: 'Odeslat',
|
||||||
|
parent: {
|
||||||
|
nameSurname: 'Jméno a příjmení zákonného zástupce',
|
||||||
|
email: 'E-mail zákonného zástupce',
|
||||||
|
telephone: 'Telefon zákonného zástupce'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -112,6 +112,70 @@ type RootTranslation = {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
input: {
|
input: {
|
||||||
|
/**
|
||||||
|
* nepovinné
|
||||||
|
*/
|
||||||
|
optional: string
|
||||||
|
/**
|
||||||
|
* Jméno a příjmení
|
||||||
|
*/
|
||||||
|
nameSurname: string
|
||||||
|
/**
|
||||||
|
* E-mail
|
||||||
|
*/
|
||||||
|
email: string
|
||||||
|
/**
|
||||||
|
* Telefon
|
||||||
|
*/
|
||||||
|
telephone: string
|
||||||
|
/**
|
||||||
|
* Ulice a č. p.
|
||||||
|
*/
|
||||||
|
address: string
|
||||||
|
/**
|
||||||
|
* PSČ
|
||||||
|
*/
|
||||||
|
zipCode: string
|
||||||
|
/**
|
||||||
|
* Město
|
||||||
|
*/
|
||||||
|
city: string
|
||||||
|
/**
|
||||||
|
* Místo narození
|
||||||
|
*/
|
||||||
|
birthPlace: string
|
||||||
|
/**
|
||||||
|
* Datum narození
|
||||||
|
*/
|
||||||
|
birthDate: string
|
||||||
|
/**
|
||||||
|
* Pohlaví
|
||||||
|
*/
|
||||||
|
sex: string
|
||||||
|
/**
|
||||||
|
* Občanství
|
||||||
|
*/
|
||||||
|
citizenship: string
|
||||||
|
/**
|
||||||
|
* Jazyk odborných testů
|
||||||
|
*/
|
||||||
|
testLanguage: string
|
||||||
|
/**
|
||||||
|
* IZO školy
|
||||||
|
*/
|
||||||
|
schoolIzo: string
|
||||||
|
/**
|
||||||
|
* Název školy
|
||||||
|
*/
|
||||||
|
schoolName: string
|
||||||
|
/**
|
||||||
|
* Číslo zdravotní pojišťovny
|
||||||
|
*/
|
||||||
|
insuranceNumber: string
|
||||||
|
/**
|
||||||
|
* Rodné číslo
|
||||||
|
*/
|
||||||
|
personalIdentificationNumber: string
|
||||||
/**
|
/**
|
||||||
* Ev. číslo
|
* Ev. číslo
|
||||||
*/
|
*/
|
||||||
|
|
@ -128,6 +192,20 @@ type RootTranslation = {
|
||||||
* Odeslat
|
* Odeslat
|
||||||
*/
|
*/
|
||||||
submit: string
|
submit: string
|
||||||
|
parent: {
|
||||||
|
/**
|
||||||
|
* Jméno a příjmení zákonného zástupce
|
||||||
|
*/
|
||||||
|
nameSurname: string
|
||||||
|
/**
|
||||||
|
* E-mail zákonného zástupce
|
||||||
|
*/
|
||||||
|
email: string
|
||||||
|
/**
|
||||||
|
* Telefon zákonného zástupce
|
||||||
|
*/
|
||||||
|
telephone: string
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -227,6 +305,70 @@ export type TranslationFunctions = {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
input: {
|
input: {
|
||||||
|
/**
|
||||||
|
* nepovinné
|
||||||
|
*/
|
||||||
|
optional: () => LocalizedString
|
||||||
|
/**
|
||||||
|
* Jméno a příjmení
|
||||||
|
*/
|
||||||
|
nameSurname: () => LocalizedString
|
||||||
|
/**
|
||||||
|
* E-mail
|
||||||
|
*/
|
||||||
|
email: () => LocalizedString
|
||||||
|
/**
|
||||||
|
* Telefon
|
||||||
|
*/
|
||||||
|
telephone: () => LocalizedString
|
||||||
|
/**
|
||||||
|
* Ulice a č. p.
|
||||||
|
*/
|
||||||
|
address: () => LocalizedString
|
||||||
|
/**
|
||||||
|
* PSČ
|
||||||
|
*/
|
||||||
|
zipCode: () => LocalizedString
|
||||||
|
/**
|
||||||
|
* Město
|
||||||
|
*/
|
||||||
|
city: () => LocalizedString
|
||||||
|
/**
|
||||||
|
* Místo narození
|
||||||
|
*/
|
||||||
|
birthPlace: () => LocalizedString
|
||||||
|
/**
|
||||||
|
* Datum narození
|
||||||
|
*/
|
||||||
|
birthDate: () => LocalizedString
|
||||||
|
/**
|
||||||
|
* Pohlaví
|
||||||
|
*/
|
||||||
|
sex: () => LocalizedString
|
||||||
|
/**
|
||||||
|
* Občanství
|
||||||
|
*/
|
||||||
|
citizenship: () => LocalizedString
|
||||||
|
/**
|
||||||
|
* Jazyk odborných testů
|
||||||
|
*/
|
||||||
|
testLanguage: () => LocalizedString
|
||||||
|
/**
|
||||||
|
* IZO školy
|
||||||
|
*/
|
||||||
|
schoolIzo: () => LocalizedString
|
||||||
|
/**
|
||||||
|
* Název školy
|
||||||
|
*/
|
||||||
|
schoolName: () => LocalizedString
|
||||||
|
/**
|
||||||
|
* Číslo zdravotní pojišťovny
|
||||||
|
*/
|
||||||
|
insuranceNumber: () => LocalizedString
|
||||||
|
/**
|
||||||
|
* Rodné číslo
|
||||||
|
*/
|
||||||
|
personalIdentificationNumber: () => LocalizedString
|
||||||
/**
|
/**
|
||||||
* Ev. číslo
|
* Ev. číslo
|
||||||
*/
|
*/
|
||||||
|
|
@ -243,6 +385,20 @@ export type TranslationFunctions = {
|
||||||
* Odeslat
|
* Odeslat
|
||||||
*/
|
*/
|
||||||
submit: () => LocalizedString
|
submit: () => LocalizedString
|
||||||
|
parent: {
|
||||||
|
/**
|
||||||
|
* Jméno a příjmení zákonného zástupce
|
||||||
|
*/
|
||||||
|
nameSurname: () => LocalizedString
|
||||||
|
/**
|
||||||
|
* E-mail zákonného zástupce
|
||||||
|
*/
|
||||||
|
email: () => LocalizedString
|
||||||
|
/**
|
||||||
|
* Telefon zákonného zástupce
|
||||||
|
*/
|
||||||
|
telephone: () => LocalizedString
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue