1
0
mirror of https://github.com/pocket-id/pocket-id.git synced 2026-02-14 19:57:31 +00:00

feat: add support for translations (#349)

Co-authored-by: Kyle Mendell <kmendell@outlook.com>
Co-authored-by: Elias Schneider <login@eliasschneider.com>
This commit is contained in:
Jonas Claes
2025-03-20 19:57:41 +01:00
committed by GitHub
parent 041c565dc1
commit 269b5a3c92
83 changed files with 1567 additions and 453 deletions

View File

@@ -1,5 +1,6 @@
<script lang="ts">
import * as Card from '$lib/components/ui/card';
import { m } from '$lib/paraglide/messages';
import AuditLogList from './audit-log-list.svelte';
let { data } = $props();
@@ -8,14 +9,14 @@
</script>
<svelte:head>
<title>Audit Log</title>
<title>{m.audit_log()}</title>
</svelte:head>
<Card.Root>
<Card.Header>
<Card.Title>Audit Log</Card.Title>
<Card.Title>{m.audit_log()}</Card.Title>
<Card.Description class="mt-1"
>See your account activities from the last 3 months.</Card.Description
>{m.see_your_account_activities_from_the_last_3_months()}</Card.Description
>
</Card.Header>
<Card.Content>

View File

@@ -2,6 +2,7 @@
import AdvancedTable from '$lib/components/advanced-table.svelte';
import { Badge } from '$lib/components/ui/badge';
import * as Table from '$lib/components/ui/table';
import { m } from '$lib/paraglide/messages';
import AuditLogService from '$lib/services/audit-log-service';
import type { AuditLog } from '$lib/types/audit-log.type';
import type { Paginated, SearchPaginationSortRequest } from '$lib/types/pagination.type';
@@ -27,12 +28,12 @@
{requestOptions}
onRefresh={async (options) => (auditLogs = await auditLogService.list(options))}
columns={[
{ label: 'Time', sortColumn: 'createdAt' },
{ label: 'Event', sortColumn: 'event' },
{ label: 'Approximate Location', sortColumn: 'city' },
{ label: 'IP Address', sortColumn: 'ipAddress' },
{ label: 'Device', sortColumn: 'device' },
{ label: 'Client' }
{ label: m.time(), sortColumn: 'createdAt' },
{ label: m.event(), sortColumn: 'event' },
{ label: m.approximate_location(), sortColumn: 'city' },
{ label: m.ip_address(), sortColumn: 'ipAddress' },
{ label: m.device(), sortColumn: 'device' },
{ label: m.client() }
]}
withoutSearch
>
@@ -42,7 +43,7 @@
<Badge variant="outline">{toFriendlyEventString(item.event)}</Badge>
</Table.Cell>
<Table.Cell
>{item.city && item.country ? `${item.city}, ${item.country}` : 'Unknown'}</Table.Cell
>{item.city && item.country ? `${item.city}, ${item.country}` : m.unknown()}</Table.Cell
>
<Table.Cell>{item.ipAddress}</Table.Cell>
<Table.Cell>{item.device}</Table.Cell>