i18n(transcription): add reader read-label and panel title strings (#697)
transcription_read_label ("Transkription lesen") for the read-only entry
control and transcription_panel_title ("Transkription") for the plain
header readers see instead of the Lesen/Bearbeiten toggle.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -5,6 +5,7 @@ import { clickOutside } from '$lib/shared/actions/clickOutside';
|
||||
type Props = {
|
||||
canWrite: boolean;
|
||||
isPdf: boolean;
|
||||
hasTranscription: boolean;
|
||||
transcribeMode: boolean;
|
||||
filePath?: string | null;
|
||||
originalFilename?: string | null;
|
||||
@@ -14,12 +15,18 @@ type Props = {
|
||||
let {
|
||||
canWrite,
|
||||
isPdf,
|
||||
hasTranscription,
|
||||
transcribeMode = $bindable(),
|
||||
filePath = null,
|
||||
originalFilename = null,
|
||||
fileUrl
|
||||
}: Props = $props();
|
||||
|
||||
const canOpenTranscription = $derived((canWrite || hasTranscription) && isPdf);
|
||||
const transcriptionLabel = $derived(
|
||||
canWrite ? m.transcription_mode_label() : m.transcription_read_label()
|
||||
);
|
||||
|
||||
let mobileMenuOpen = $state(false);
|
||||
|
||||
function startTranscribe() {
|
||||
@@ -50,10 +57,10 @@ function startTranscribe() {
|
||||
role="menu"
|
||||
class="absolute top-full right-0 z-50 mt-1 min-w-[200px] rounded-md border border-line bg-surface p-2 shadow-lg"
|
||||
>
|
||||
{#if canWrite && isPdf && !transcribeMode}
|
||||
{#if canOpenTranscription && !transcribeMode}
|
||||
<button
|
||||
onclick={startTranscribe}
|
||||
aria-label={m.transcription_mode_label()}
|
||||
aria-label={transcriptionLabel}
|
||||
aria-pressed={false}
|
||||
class="flex w-full items-center gap-2 rounded px-3 py-2 text-left text-[16px] text-ink transition hover:bg-muted focus-visible:ring-2 focus-visible:ring-primary"
|
||||
>
|
||||
@@ -70,7 +77,7 @@ function startTranscribe() {
|
||||
d="M19.5 14.25v-2.625a3.375 3.375 0 00-3.375-3.375h-1.5A1.125 1.125 0 0113.5 7.125v-1.5a3.375 3.375 0 00-3.375-3.375H8.25m0 12.75h7.5m-7.5 3H12M10.5 2.25H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 00-9-9z"
|
||||
/>
|
||||
</svg>
|
||||
{m.transcription_mode_label()}
|
||||
{transcriptionLabel}
|
||||
</button>
|
||||
{/if}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user