feat: translate dashboardUploadCard

This commit is contained in:
EETagent 2023-01-24 17:56:21 +01:00
parent c96e14c897
commit d9b097fb48
3 changed files with 65 additions and 5 deletions

View file

@ -1,4 +1,6 @@
<script lang="ts">
import LL from '$i18n/i18n-svelte';
import FileType from './FileType.svelte';
import debounce from 'just-debounce-it';
import { filedrop, type FileDropOptions, type Files } from 'filedrop-svelte';
@ -103,7 +105,7 @@
{#if status === 'uploaded'}
<button
class="mr-3 rounded-xl bg-[#ef8b46] py-0.5 px-2 text-white shadow-md transition-all duration-300 hover:bg-orange-400"
on:click={debounce(() => dispatch('delete'), 150)}>Smazat</button
on:click={debounce(() => dispatch('delete'), 150)}>{$LL.components.dashboard.dashboardUploadCard.delete()}</button
>
{/if}
<StatusNotificationDot {status} />
@ -131,9 +133,9 @@
>
<div class="hidden items-center xl:block">
{#if bytesTotal === 0 || Math.round(progress * 100) === 100}
<h2 class="text-xl font-bold">{status === 'submitted' ? 'Odesláno' : 'Nahráno'}</h2>
<h2 class="text-xl font-bold">{status === 'submitted' ? $LL.components.dashboard.dashboardUploadCard.sent() : $LL.components.dashboard.dashboardUploadCard.uploaded()}</h2>
{:else}
<h2 class="text-xl">Nahráno {((bytesTotal / 1_000_000) * progress).toFixed(1)} MB</h2>
<h2 class="text-xl">{$LL.components.dashboard.dashboardUploadCard.uploaded()} {((bytesTotal / 1_000_000) * progress).toFixed(1)} MB</h2>
<h2 class="self-center text-xl">z {(bytesTotal / 1_000_000).toFixed(1)} MB</h2>
{/if}
</div>
@ -168,8 +170,14 @@
{#if error}
<span class="font-semibold text-red-600">{error}</span>
{:else}
<span class="text-[#406280]">Sem přetáhněte,</span>
<span class="text-sspsGray">nebo nahrajte {placeholder}</span>
<span class="text-[#406280]"
>{$LL.components.dashboard.dashboardUploadCard.dropHere()}</span
>
<span class="text-sspsGray"
>{$LL.components.dashboard.dashboardUploadCard.orUpload({
placeholder
})}</span
>
{/if}
</div>
</div>

View file

@ -73,6 +73,13 @@ const cs: BaseTranslation = {
coverLetterUploadCard: {
title: "Motivační dopis",
placeholder: "svůj motivanční dopis",
},
dashboardUploadCard: {
dropHere: "Sem přetáhněte,",
orUpload: "Nebo nahrajte {placeholder:string}",
uploaded: "Nahráno",
sent: "Odesláno",
delete: "Smazat",
}
},
checkbox: {

View file

@ -161,6 +161,29 @@ type RootTranslation = {
*/
placeholder: string
}
dashboardUploadCard: {
/**
* Sem přetáhněte,
*/
dropHere: string
/**
* Nebo nahrajte {placeholder}
* @param {string} placeholder
*/
orUpload: RequiredParams<'placeholder'>
/**
* Nahráno
*/
uploaded: string
/**
* Odesláno
*/
sent: string
/**
* Smazat
*/
'delete': string
}
}
checkbox: {
accountLinkCheckBox: {
@ -464,6 +487,28 @@ export type TranslationFunctions = {
*/
placeholder: () => LocalizedString
}
dashboardUploadCard: {
/**
* Sem přetáhněte,
*/
dropHere: () => LocalizedString
/**
* Nebo nahrajte {placeholder}
*/
orUpload: (arg: { placeholder: string }) => LocalizedString
/**
* Nahráno
*/
uploaded: () => LocalizedString
/**
* Odesláno
*/
sent: () => LocalizedString
/**
* Smazat
*/
'delete': () => LocalizedString
}
}
checkbox: {
accountLinkCheckBox: {