Files
obsidian-livesync/src/modules/features/SetupWizard/dialogs/OutroNewUser.svelte
T
ZeedifandClaude Opus 5 b6746be73e refactor(i18n): route remaining Obsidian UI text through the message catalogue
Continues the source-key migration inside the application boundary introduced
in 1.0.0, where LiveSync owns its catalogue and consumes Commonlib as a
published package.

- Replace hardcoded user-visible strings in the Obsidian UI (Setup Wizard
  dialogues, P2P panes, Customisation Sync panes, Global History, the JSON
  conflict pane and the remote-configuration menu) with `$msg` calls, keeping
  the English source string as the key.
- Wire up strings whose translations already existed in the catalogue but were
  still rendered as literals, for example the whole Intro dialogue.
- Add the new entries to `src/common/messagesYAML/en.yaml` and `es.yaml`, then
  regenerate `messagesJson/` and `combinedMessages.prod.ts` through the
  documented `i18n:bake` pipeline.
- No Commonlib gitlink or catalogue is involved; every change is
  LiveSync-owned.

Regenerating the catalogue also normalises three pre-existing entries each in
`ko.json` and `zh.json`, where the committed JSON kept a trailing space before
a newline that YAML cannot represent.

Verified with tsc-check, tsc-check:apps, svelte-check and lint.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-30 18:59:19 -06:00

71 lines
3.0 KiB
Svelte

<script lang="ts">
import DialogHeader from "@/modules/services/LiveSyncUI/components/DialogHeader.svelte";
import Guidance from "@/modules/services/LiveSyncUI/components/Guidance.svelte";
import Decision from "@/modules/services/LiveSyncUI/components/Decision.svelte";
import Question from "@/modules/services/LiveSyncUI/components/Question.svelte";
import Instruction from "@/modules/services/LiveSyncUI/components/Instruction.svelte";
import UserDecisions from "@/modules/services/LiveSyncUI/components/UserDecisions.svelte";
import { $msg as msg } from "@/common/translation";
import { TYPE_APPLY, TYPE_CANCELLED, type OutroNewUserResultType } from "./setupDialogTypes";
type Props = {
setResult: (result: OutroNewUserResultType) => void;
getInitialData?: () => { isP2P?: boolean } | undefined;
};
const { setResult, getInitialData }: Props = $props();
const isP2P = $derived(getInitialData?.()?.isP2P === true);
// let userType = $state<OutroNewUserResultType>(TYPE_CANCELLED);
</script>
{#if isP2P}
<DialogHeader title={msg("Ui.SetupWizard.OutroNewP2PUser.Title")} />
<Guidance>
<p>{msg("Ui.SetupWizard.OutroNewP2PUser.GuidancePrimary")}</p>
<p>
<strong>{msg("Ui.SetupWizard.OutroNewP2PUser.Important")}</strong>
<br />
{msg("Ui.SetupWizard.OutroNewP2PUser.GuidanceNotice")}
</p>
</Guidance>
<Instruction>
<Question>{msg("Ui.SetupWizard.OutroNewP2PUser.Question")}</Question>
</Instruction>
<UserDecisions>
<Decision
title={msg("Ui.SetupWizard.OutroNewP2PUser.Proceed")}
important={true}
commit={() => setResult(TYPE_APPLY)}
/>
<Decision title={msg("No, please take me back")} commit={() => setResult(TYPE_CANCELLED)} />
</UserDecisions>
{:else}
<DialogHeader title={msg("Setup Complete: Preparing to Initialise Server")} />
<Guidance>
<p>
{msg("The connection to the server has been configured successfully. As the next step,")} <strong
>{msg(
"the synchronisation data on the server will be built based on the current data on this device."
)}</strong
>
</p>
<p>
<strong>{msg("IMPORTANT")}</strong>
<br />
{msg(
"After restarting, the data on this device will be uploaded to the server as the 'master copy'. Please be aware that any unintended data currently on the server will be completely overwritten."
)}
</p>
</Guidance>
<Instruction>
<Question>{msg("Please select the button below to restart and proceed to the final confirmation.")}</Question>
</Instruction>
<UserDecisions>
<Decision
title={msg("Restart and Initialise Server")}
important={true}
commit={() => setResult(TYPE_APPLY)}
/>
<Decision title={msg("No, please take me back")} commit={() => setResult(TYPE_CANCELLED)} />
</UserDecisions>
{/if}