Skip to content

armgit / papra

Public Imported from GitHub
0

The minimalistic document archiving platform.

fix(i18n): added translations for document table headers (#618)

Corentin Thomasset868281bcffee
diff --git a/.changeset/chatty-impalas-knock.md b/.changeset/chatty-impalas-knock.md
new file mode 100644
index 00000000..ed3da45b
--- /dev/null
+++ b/.changeset/chatty-impalas-knock.md
@@ -0,0 +1,5 @@
+---
+"@papra/docker": patch
+---
+
+Added translations for document table headers
diff --git a/apps/papra-client/src/locales/de.dictionary.ts b/apps/papra-client/src/locales/de.dictionary.ts
index 8916b4bd..d1611358 100644
--- a/apps/papra-client/src/locales/de.dictionary.ts
+++ b/apps/papra-client/src/locales/de.dictionary.ts
@@ -249,6 +249,11 @@ export const translations: Partial<TranslationsDictionary> = {
'documents.list.no-documents.title': 'Keine Dokumente',
'documents.list.no-documents.description': 'Es sind noch keine Dokumente in dieser Organisation vorhanden. Beginnen Sie mit dem Hochladen von Dokumenten.',
'documents.list.no-results': 'Keine Dokumente gefunden',
+ 'documents.list.table.headers.file-name': 'Dateiname',
+ 'documents.list.table.headers.created': 'Erstellt am',
+ 'documents.list.table.headers.deleted': 'Gelöscht am',
+ 'documents.list.table.headers.actions': 'Aktionen',
+ 'documents.list.table.headers.tags': 'Tags',
'documents.tabs.info': 'Info',
'documents.tabs.content': 'Inhalt',
diff --git a/apps/papra-client/src/locales/en.dictionary.ts b/apps/papra-client/src/locales/en.dictionary.ts
index 633f61f8..a5e951b7 100644
--- a/apps/papra-client/src/locales/en.dictionary.ts
+++ b/apps/papra-client/src/locales/en.dictionary.ts
@@ -247,6 +247,11 @@ export const translations = {
'documents.list.no-documents.title': 'No documents',
'documents.list.no-documents.description': 'There are no documents in this organization yet. Start by uploading some documents.',
'documents.list.no-results': 'No documents found',
+ 'documents.list.table.headers.file-name': 'File name',
+ 'documents.list.table.headers.created': 'Created at',
+ 'documents.list.table.headers.deleted': 'Deleted at',
+ 'documents.list.table.headers.actions': 'Actions',
+ 'documents.list.table.headers.tags': 'Tags',
'documents.tabs.info': 'Info',
'documents.tabs.content': 'Content',
diff --git a/apps/papra-client/src/locales/es.dictionary.ts b/apps/papra-client/src/locales/es.dictionary.ts
index db65a245..6f01046e 100644
--- a/apps/papra-client/src/locales/es.dictionary.ts
+++ b/apps/papra-client/src/locales/es.dictionary.ts
@@ -249,6 +249,11 @@ export const translations: Partial<TranslationsDictionary> = {
'documents.list.no-documents.title': 'Sin documentos',
'documents.list.no-documents.description': 'Aún no hay documentos en esta organización. Comienza subiendo algunos documentos.',
'documents.list.no-results': 'No se encontraron documentos',
+ 'documents.list.table.headers.file-name': 'Nombre de archivo',
+ 'documents.list.table.headers.created': 'Creado el',
+ 'documents.list.table.headers.deleted': 'Eliminado el',
+ 'documents.list.table.headers.actions': 'Acciones',
+ 'documents.list.table.headers.tags': 'Etiquetas',
'documents.tabs.info': 'Información',
'documents.tabs.content': 'Contenido',
diff --git a/apps/papra-client/src/locales/fr.dictionary.ts b/apps/papra-client/src/locales/fr.dictionary.ts
index 7e0bbc47..1b9a42dd 100644
--- a/apps/papra-client/src/locales/fr.dictionary.ts
+++ b/apps/papra-client/src/locales/fr.dictionary.ts
@@ -249,6 +249,11 @@ export const translations: Partial<TranslationsDictionary> = {
'documents.list.no-documents.title': 'Aucun document',
'documents.list.no-documents.description': 'Il n\'y a pas de documents dans cette organisation. Commencez par télécharger des documents.',
'documents.list.no-results': 'Aucun document trouvé',
+ 'documents.list.table.headers.file-name': 'Nom du fichier',
+ 'documents.list.table.headers.created': 'Créé le',
+ 'documents.list.table.headers.deleted': 'Supprimé le',
+ 'documents.list.table.headers.actions': 'Actions',
+ 'documents.list.table.headers.tags': 'Étiquettes',
'documents.tabs.info': 'Info',
'documents.tabs.content': 'Contenu',
diff --git a/apps/papra-client/src/locales/it.dictionary.ts b/apps/papra-client/src/locales/it.dictionary.ts
index 35c6a657..0d49d883 100644
--- a/apps/papra-client/src/locales/it.dictionary.ts
+++ b/apps/papra-client/src/locales/it.dictionary.ts
@@ -249,6 +249,11 @@ export const translations: Partial<TranslationsDictionary> = {
'documents.list.no-documents.title': 'Nessun documento',
'documents.list.no-documents.description': 'Non ci sono ancora documenti in questa organizzazione. Inizia caricando dei documenti.',
'documents.list.no-results': 'Nessun documento trovato',
+ 'documents.list.table.headers.file-name': 'Nome file',
+ 'documents.list.table.headers.created': 'Creato il',
+ 'documents.list.table.headers.deleted': 'Eliminato il',
+ 'documents.list.table.headers.actions': 'Azioni',
+ 'documents.list.table.headers.tags': 'Tag',
'documents.tabs.info': 'Info',
'documents.tabs.content': 'Contenuto',
diff --git a/apps/papra-client/src/locales/nl.dictionary.ts b/apps/papra-client/src/locales/nl.dictionary.ts
index 4cac5b38..95736fcc 100644
--- a/apps/papra-client/src/locales/nl.dictionary.ts
+++ b/apps/papra-client/src/locales/nl.dictionary.ts
@@ -249,6 +249,11 @@ export const translations: Partial<TranslationsDictionary> = {
'documents.list.no-documents.title': 'Geen documenten',
'documents.list.no-documents.description': 'Er staan nog geen documenten in deze organisatie. Begin met het uploaden van documenten.',
'documents.list.no-results': 'Geen documenten gevonden',
+ 'documents.list.table.headers.file-name': 'Bestandsnaam',
+ 'documents.list.table.headers.created': 'Aangemaakt op',
+ 'documents.list.table.headers.deleted': 'Verwijderd op',
+ 'documents.list.table.headers.actions': 'Acties',
+ 'documents.list.table.headers.tags': 'Tags',
'documents.tabs.info': 'Info',
'documents.tabs.content': 'Inhoud',
@@ -710,4 +715,4 @@ export const translations: Partial<TranslationsDictionary> = {
// Common / Shared
'common.confirm-modal.type-to-confirm': 'Typ "{{ text }}" om te bevestigen',
-} as const;
+};
diff --git a/apps/papra-client/src/locales/pl.dictionary.ts b/apps/papra-client/src/locales/pl.dictionary.ts
index 96869ebd..618194fc 100644
--- a/apps/papra-client/src/locales/pl.dictionary.ts
+++ b/apps/papra-client/src/locales/pl.dictionary.ts
@@ -249,6 +249,11 @@ export const translations: Partial<TranslationsDictionary> = {
'documents.list.no-documents.title': 'Brak dokumentów',
'documents.list.no-documents.description': 'W tej organizacji nie ma jeszcze żadnych dokumentów. Zacznij od przesłania kilku dokumentów.',
'documents.list.no-results': 'Nie znaleziono dokumentów',
+ 'documents.list.table.headers.file-name': 'Nazwa pliku',
+ 'documents.list.table.headers.created': 'Utworzono',
+ 'documents.list.table.headers.deleted': 'Usunięto',
+ 'documents.list.table.headers.actions': 'Akcje',
+ 'documents.list.table.headers.tags': 'Tagi',
'documents.tabs.info': 'Informacje',
'documents.tabs.content': 'Treść',
diff --git a/apps/papra-client/src/locales/pt-BR.dictionary.ts b/apps/papra-client/src/locales/pt-BR.dictionary.ts
index 715a7a48..fe0c415b 100644
--- a/apps/papra-client/src/locales/pt-BR.dictionary.ts
+++ b/apps/papra-client/src/locales/pt-BR.dictionary.ts
@@ -249,6 +249,11 @@ export const translations: Partial<TranslationsDictionary> = {
'documents.list.no-documents.title': 'Nenhum documento',
'documents.list.no-documents.description': 'Ainda não há documentos nesta organização. Comece enviando documentos.',
'documents.list.no-results': 'Nenhum documento encontrado',
+ 'documents.list.table.headers.file-name': 'Nome do arquivo',
+ 'documents.list.table.headers.created': 'Criado em',
+ 'documents.list.table.headers.deleted': 'Excluído em',
+ 'documents.list.table.headers.actions': 'Ações',
+ 'documents.list.table.headers.tags': 'Tags',
'documents.tabs.info': 'Informações',
'documents.tabs.content': 'Conteúdo',
diff --git a/apps/papra-client/src/locales/pt.dictionary.ts b/apps/papra-client/src/locales/pt.dictionary.ts
index 9a3dad63..7ed9482b 100644
--- a/apps/papra-client/src/locales/pt.dictionary.ts
+++ b/apps/papra-client/src/locales/pt.dictionary.ts
@@ -249,6 +249,11 @@ export const translations: Partial<TranslationsDictionary> = {
'documents.list.no-documents.title': 'Sem documentos',
'documents.list.no-documents.description': 'Não há documentos nesta organização ainda. Comece por carregar alguns documentos.',
'documents.list.no-results': 'Nenhum documento encontrado',
+ 'documents.list.table.headers.file-name': 'Nome do ficheiro',
+ 'documents.list.table.headers.created': 'Criado em',
+ 'documents.list.table.headers.deleted': 'Eliminado em',
+ 'documents.list.table.headers.actions': 'Ações',
+ 'documents.list.table.headers.tags': 'Etiquetas',
'documents.tabs.info': 'Informação',
'documents.tabs.content': 'Conteúdo',
diff --git a/apps/papra-client/src/locales/ro.dictionary.ts b/apps/papra-client/src/locales/ro.dictionary.ts
index af809416..80bccca0 100644
--- a/apps/papra-client/src/locales/ro.dictionary.ts
+++ b/apps/papra-client/src/locales/ro.dictionary.ts
@@ -249,6 +249,11 @@ export const translations: Partial<TranslationsDictionary> = {
'documents.list.no-documents.title': 'Niciun document',
'documents.list.no-documents.description': 'Încă nu există documente în aceasta organizație. Începe prin a încarca câteva documente.',
'documents.list.no-results': 'Nu au fost găsite documente',
+ 'documents.list.table.headers.file-name': 'Nume fișier',
+ 'documents.list.table.headers.created': 'Creat la',
+ 'documents.list.table.headers.deleted': 'Șters la',
+ 'documents.list.table.headers.actions': 'Acțiuni',
+ 'documents.list.table.headers.tags': 'Etichete',
'documents.tabs.info': 'Info',
'documents.tabs.content': 'Conținut',
diff --git a/apps/papra-client/src/modules/documents/components/documents-list.component.tsx b/apps/papra-client/src/modules/documents/components/documents-list.component.tsx
index 21f4a794..a8f75fb1 100644
--- a/apps/papra-client/src/modules/documents/components/documents-list.component.tsx
+++ b/apps/papra-client/src/modules/documents/components/documents-list.component.tsx
@@ -4,9 +4,15 @@ import type { Document } from '../documents.types';
import type { Tag } from '@/modules/tags/tags.types';
import { formatBytes } from '@corentinth/chisels';
import { A } from '@solidjs/router';
-import { createSolidTable, flexRender, getCoreRowModel, getPaginationRowModel } from '@tanstack/solid-table';
+import {
+ createSolidTable,
+ flexRender,
+ getCoreRowModel,
+ getPaginationRowModel,
+} from '@tanstack/solid-table';
import { For, Match, Show, Switch } from 'solid-js';
import { RelativeTime } from '@/modules/i18n/components/RelativeTime';
+import { useI18n } from '@/modules/i18n/i18n.provider';
import { cn } from '@/modules/shared/style/cn';
import { TagLink } from '@/modules/tags/components/tag.component';
import { Button } from '@/modules/ui/components/button';
@@ -21,19 +27,28 @@ type Pagination = {
};
export const createdAtColumn: ColumnDef<Document> = {
- header: () => (<span class="hidden sm:block">Created at</span>),
+ header: () => {
+ const { t } = useI18n();
+ return <span class="hidden sm:block">{t('documents.list.table.headers.created')}</span>;
+ },
accessorKey: 'createdAt',
cell: data => <RelativeTime class="text-muted-foreground hidden sm:block" date={data.getValue<Date>()} />,
};
export const deletedAtColumn: ColumnDef<Document> = {
- header: () => (<span class="hidden sm:block">Deleted at</span>),
+ header: () => {
+ const { t } = useI18n();
+ return <span class="hidden sm:block">{t('documents.list.table.headers.deleted')}</span>;
+ },
accessorKey: 'deletedAt',
cell: data => <RelativeTime class="text-muted-foreground hidden sm:block" date={data.getValue<Date>()} />,
};
export const standardActionsColumn: ColumnDef<Document> = {
- header: () => (<span class="block text-right">Actions</span>),
+ header: () => {
+ const { t } = useI18n();
+ return <span class="block text-right">{t('documents.list.table.headers.actions')}</span>;
+ },
id: 'actions',
cell: data => (
<div class="flex items-center justify-end">
@@ -43,14 +58,15 @@ export const standardActionsColumn: ColumnDef<Document> = {
};
export const tagsColumn: ColumnDef<Document> = {
- header: () => (<span class="hidden sm:block">Tags</span>),
+ header: () => {
+ const { t } = useI18n();
+ return <span class="hidden sm:block">{t('documents.list.table.headers.tags')}</span>;
+ },
accessorKey: 'tags',
cell: data => (
<div class="text-muted-foreground hidden sm:flex flex-wrap gap-1">
<For each={data.getValue<Tag[]>()}>
- {tag => (
- <TagLink {...tag} class="text-xs" />
- )}
+ {tag => <TagLink {...tag} class="text-xs" />}
</For>
</div>
),
@@ -64,17 +80,25 @@ export const DocumentsPaginatedList: Component<{
extraColumns?: ColumnDef<Document>[];
showPagination?: boolean;
}> = (props) => {
+ const { t } = useI18n();
const table = createSolidTable({
get data() {
return props.documents ?? [];
},
columns: [
{
- header: 'File name',
+ header: () => t('documents.list.table.headers.file-name'),
+ id: 'fileName',
cell: data => (
<div class="overflow-hidden flex gap-4 items-center">
<div class="bg-muted flex items-center justify-center p-2 rounded-lg">
- <div class={cn(getDocumentIcon({ document: data.row.original }), 'size-6 text-primary')}></div>
+ <div
+ class={cn(
+ getDocumentIcon({ document: data.row.original }),
+ 'size-6 text-primary',
+ )}
+ >
+ </div>
</div>
<div class="flex-1 flex flex-col gap-1 truncate">
@@ -82,7 +106,9 @@ export const DocumentsPaginatedList: Component<{
href={`/organizations/${data.row.original.organizationId}/documents/${data.row.original.id}`}
class="font-bold truncate block hover:underline"
>
- {getDocumentNameWithoutExtension({ name: data.row.original.name })}
+ {getDocumentNameWithoutExtension({
+ name: data.row.original.name,
+ })}
</A>
<div class="text-xs text-muted-foreground lh-tight">
@@ -94,24 +120,8 @@ export const DocumentsPaginatedList: Component<{
</div>
</div>
</div>
-
),
},
- // {
- // header: () => (<span class="hidden sm:block">Created at</span>),
- // accessorKey: 'createdAt',
- // cell: data => <div class="text-muted-foreground hidden sm:block" title={data.getValue<Date>().toLocaleString()}>{timeAgo({ date: data.getValue<Date>() })}</div>,
- // },
- // {
- // header: () => (<span class="block text-right">Actions</span>),
- // id: 'actions',
- // cell: data => (
- // <div class="flex items-center justify-end">
- // <DocumentManagementDropdown documentId={data.row.original.id} organizationId={data.row.original.organizationId} />
- // </div>
- // ),
- // },
-
...(props.extraColumns ?? []),
],
get rowCount() {
@@ -126,7 +136,6 @@ export const DocumentsPaginatedList: Component<{
},
},
manualPagination: true,
-
});
return (
@@ -134,7 +143,6 @@ export const DocumentsPaginatedList: Component<{
<Switch>
<Match when={props.documentsCount > 0}>
<Table>
-
<TableHeader>
<For each={table.getHeaderGroups()}>
{headerGroup => (
@@ -145,7 +153,10 @@ export const DocumentsPaginatedList: Component<{
<TableHead>
{header.isPlaceholder
? null
- : flexRender(header.column.columnDef.header, header.getContext())}
+ : flexRender(
+ header.column.columnDef.header,
+ header.getContext(),
+ )}
</TableHead>
);
}}
@@ -163,7 +174,10 @@ export const DocumentsPaginatedList: Component<{
<For each={row.getVisibleCells()}>
{cell => (
<TableCell>
- {flexRender(cell.column.columnDef.cell, cell.getContext())}
+ {flexRender(
+ cell.column.columnDef.cell,
+ cell.getContext(),
+ )}
</TableCell>
)}
</For>
@@ -172,19 +186,22 @@ export const DocumentsPaginatedList: Component<{
</For>
</Show>
</TableBody>
-
</Table>
<Show when={props.showPagination ?? true}>
<div class="flex flex-col-reverse items-center gap-4 sm:flex-row sm:justify-end mt-4">
<div class="flex items-center space-x-2">
- <p class="whitespace-nowrap text-sm font-medium">Rows per page</p>
+ <p class="whitespace-nowrap text-sm font-medium">
+ Rows per page
+ </p>
<Select
value={table.getState().pagination.pageSize}
onChange={value => value && table.setPageSize(value)}
options={[15, 50, 100]}
itemComponent={props => (
- <SelectItem item={props.item}>{props.item.rawValue}</SelectItem>
+ <SelectItem item={props.item}>
+ {props.item.rawValue}
+ </SelectItem>
)}
>
<SelectTrigger class="h-8 w-[4.5rem]">