refactored translations, preparing sending of document

This commit is contained in:
2025-07-17 13:03:49 +02:00
parent 7616aa9581
commit dc8de9707a
38 changed files with 430 additions and 390 deletions

View File

@@ -45,7 +45,7 @@
}
async function deleteDoc(ev,doc){
if (confirm(t('document.really_delete',doc.number))){
if (confirm(t('really_delete',doc.number))){
const url = `${location.protocol}//${location.host.replace('5173','8080')}/api/document/${doc.id}`;
const resp = await fetch(url,{
credentials: 'include',
@@ -63,12 +63,12 @@
</script>
<fieldset>
<legend>{selected_company ? t( 'document.list_of',selected_company.name) : t('document.list')}</legend>
<legend>{selected_company ? t( 'list_of',selected_company.name) : t('document.list')}</legend>
{#if error}
<div class="error">{error}</div>
{/if}
<div>
{t('document.select_company')}
{t('select_company')}
{#each Object.entries(companies) as [id,company]}
<button onclick={() => load(company)}>{company.name}</button>
{/each}
@@ -77,15 +77,15 @@
<table>
<thead>
<tr>
<th>{t('document.number')}</th>
<th>{t('document.date')}</th>
<th>{t('document.customer')}</th>
<th>{t('document.gross_sum')}</th>
<th>{t('document.type')}</th>
<th>{t('document.state')}</th>
<th>{t('number')}</th>
<th>{t('date')}</th>
<th>{t('customer')}</th>
<th>{t('gross_sum')}</th>
<th>{t('type')}</th>
<th>{t('state')}</th>
<th>
{t('document.actions')}
<TypeSelector caption={t('document.create_new')} bind:value={docType} onchange={createDoc} />
{t('actions')}
<TypeSelector caption={t('create_new_document')} bind:value={docType} onchange={createDoc} />
</th>
</tr>
</thead>
@@ -96,11 +96,11 @@
<td onclick={() => show(id)}>{document.date}</td>
<td onclick={() => show(id)}>{document.customer.name.split('\n')[0]}</td>
<td onclick={() => show(id)}>{document.sum/100 + document.currency}</td>
<td onclick={() => show(id)}>{t('document.type_'+document.type)}</td>
<td onclick={() => show(id)}>{t('document.state_'+document.state.name)}</td>
<td onclick={() => show(id)}>{t('type_'+document.type)}</td>
<td onclick={() => show(id)}>{t('state_'+document.state.name)}</td>
<td>
{#if document.state.id == 1}
<button onclick={(ev) => deleteDoc(ev,document)}>{t('document.delete')}</button>
<button onclick={(ev) => deleteDoc(ev,document)}>{t('delete')}</button>
{/if}
</td>
</tr>