mirror of
https://github.com/pocket-id/pocket-id.git
synced 2026-02-11 10:39:19 +00:00
chore(translations): add missing translations (#884)
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
import { Badge } from '$lib/components/ui/badge';
|
||||
import * as Table from '$lib/components/ui/table';
|
||||
import { m } from '$lib/paraglide/messages';
|
||||
import {translateAuditLogEvent} from "$lib/utils/audit-log-translator";
|
||||
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';
|
||||
@@ -18,14 +19,6 @@
|
||||
} = $props();
|
||||
|
||||
const auditLogService = new AuditLogService();
|
||||
|
||||
function toFriendlyEventString(event: string) {
|
||||
const words = event.split('_');
|
||||
const capitalizedWords = words.map((word) => {
|
||||
return word.charAt(0).toUpperCase() + word.slice(1).toLowerCase();
|
||||
});
|
||||
return capitalizedWords.join(' ');
|
||||
}
|
||||
</script>
|
||||
|
||||
<AdvancedTable
|
||||
@@ -58,7 +51,7 @@
|
||||
</Table.Cell>
|
||||
{/if}
|
||||
<Table.Cell>
|
||||
<Badge class="rounded-full" variant="outline">{toFriendlyEventString(item.event)}</Badge>
|
||||
<Badge class="rounded-full" variant="outline">{translateAuditLogEvent(item.event)}</Badge>
|
||||
</Table.Cell>
|
||||
<Table.Cell
|
||||
>{item.city && item.country ? `${item.city}, ${item.country}` : m.unknown()}</Table.Cell
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
import * as Command from '$lib/components/ui/command';
|
||||
import * as Popover from '$lib/components/ui/popover';
|
||||
import { cn } from '$lib/utils/style';
|
||||
import { m } from '$lib/paraglide/messages';
|
||||
import { LoaderCircle, LucideCheck, LucideChevronDown } from '@lucide/svelte';
|
||||
import type { FormEventHandler } from 'svelte/elements';
|
||||
|
||||
@@ -18,9 +19,6 @@
|
||||
onSelect,
|
||||
oninput,
|
||||
isLoading = false,
|
||||
placeholder = 'Select items...',
|
||||
searchText = 'Search...',
|
||||
noItemsText = 'No items found.',
|
||||
disableInternalSearch = false,
|
||||
id
|
||||
}: {
|
||||
@@ -29,9 +27,6 @@
|
||||
onSelect?: (value: string[]) => void;
|
||||
oninput?: FormEventHandler<HTMLInputElement>;
|
||||
isLoading?: boolean;
|
||||
placeholder?: string;
|
||||
searchText?: string;
|
||||
noItemsText?: string;
|
||||
disableInternalSearch?: boolean;
|
||||
id?: string;
|
||||
} = $props();
|
||||
@@ -93,7 +88,7 @@
|
||||
<Badge variant="secondary">{label}</Badge>
|
||||
{/each}
|
||||
{:else}
|
||||
<span class="text-muted-foreground font-normal">{placeholder}</span>
|
||||
<span class="text-muted-foreground font-normal">{m.select_items()}</span>
|
||||
{/if}
|
||||
</div>
|
||||
<LucideChevronDown class="ml-2 size-4 shrink-0 opacity-50" />
|
||||
@@ -103,7 +98,7 @@
|
||||
<Popover.Content class="p-0" sameWidth>
|
||||
<Command.Root shouldFilter={false}>
|
||||
<Command.Input
|
||||
placeholder={searchText}
|
||||
placeholder={m.search()}
|
||||
value={searchValue}
|
||||
oninput={(e) => {
|
||||
filterItems(e.currentTarget.value);
|
||||
@@ -116,7 +111,7 @@
|
||||
<LoaderCircle class="size-4 animate-spin" />
|
||||
</div>
|
||||
{:else}
|
||||
{noItemsText}
|
||||
{m.no_items_found()}
|
||||
{/if}
|
||||
</Command.Empty>
|
||||
<Command.Group class="max-h-60 overflow-y-auto">
|
||||
|
||||
Reference in New Issue
Block a user