Files
obsidian-livesync/src/modules/services/LiveSyncUI/dialogues/DialogueToCopy.svelte
T
ZeedifandClaude Sonnet 5 2cefff43bb fix(i18n): repair Spanish catalogue placeholders and missing strings
- Fix %{Display language} placeholder mismatch so the language-switch
  notice resolves to the actual language name instead of leaving the
  raw token in the Spanish text.
- Translate the remaining English strings shown in the Setup Wizard
  Intro and CouchDB screens (missing setup/CouchDB copy, "Check server
  requirements", "Create/Connect to database and continue", etc.).
- Translate the Config Doctor's activation reason (previously spliced
  into the Spanish sentence as the raw English word "updated" or
  "you wanted(Thank you)!") by routing it through the catalogue at
  the two call sites that set it.
- Fix Spanish strings that kept English-style Title Case instead of
  sentence case, and route the "OK" button through the catalogue so it
  renders as "Aceptar".

Scope is limited to Spanish content plus the minimal code changes
needed to make two hard-coded strings translatable at all; no other
locale files were touched.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-23 20:33:57 -06:00

61 lines
2.2 KiB
Svelte

<script lang="ts">
import { onMount } from "svelte";
import type { GuestDialogProps } from "@/modules/services/LiveSyncUI/svelteDialog";
import DialogHeader from "@/modules/services/LiveSyncUI/components/DialogHeader.svelte";
import Instruction from "@/modules/services/LiveSyncUI/components/Instruction.svelte";
import InputRow from "@/modules/services/LiveSyncUI/components/InputRow.svelte";
import Decision from "@/modules/services/LiveSyncUI/components/Decision.svelte";
import UserDecisions from "@/modules/services/LiveSyncUI/components/UserDecisions.svelte";
import InfoNote from "@/modules/services/LiveSyncUI/components/InfoNote.svelte";
import { $msg as translateMessage } from "@/common/translation";
const TYPE_OK = "ok";
type ResultType = typeof TYPE_OK;
type Options = {
title?: string;
dataToCopy: string;
};
type Props = GuestDialogProps<ResultType, Options>;
const { setResult, getInitialData }: Props = $props();
let dataToCopy = $state("");
let title = $state<string | undefined>(undefined);
let copied = $state(false);
onMount(() => {
if (getInitialData) {
const initialData = getInitialData();
if (initialData) {
dataToCopy = initialData.dataToCopy;
title = initialData.title;
}
}
});
function commit() {
setResult(TYPE_OK);
}
async function copyToClipboard() {
await navigator.clipboard.writeText(dataToCopy);
copied = true;
}
</script>
<DialogHeader title="Your {title || 'Data'} is ready to be copied" />
<Instruction>
<InputRow label={title || translateMessage("Data to Copy")}>
<textarea readonly rows="4">{dataToCopy}</textarea>
<button onclick={() => copyToClipboard()}
>{#if !copied}📋{:else}✔️{/if}
</button>
</InputRow>
</Instruction>
<InfoNote visible={copied}>
Your {title || "data"} has been copied to the clipboard.
</InfoNote>
<UserDecisions>
<Decision title={translateMessage("Ok")} important={true} {commit} />
</UserDecisions>
<style>
textarea {
resize: none;
}
</style>